Fast followers?/Speed contagion: assessing the impact of Montreal F1 Grand Prix on high-speed ticketing rates (2000-2022)

Step 1. Weather variables. We defined the dates by year and availability (whether the event took place or not), days of the week, time windows, and pre and post-event spans, which we then linked to nearby meteorological stations. Also we linked with Collisions data.

Author

Andrés González Santa Cruz

Published

July 7, 2025

Code
# remove objects and memory
rm(list=ls());gc()
          used (Mb) gc trigger (Mb) max used (Mb)
Ncells  837600 44.8    1636887 87.5  1167794 62.4
Vcells 1709049 13.1    8388608 64.0  3475595 26.6
Code
#remove images
while(!dev.cur())dev.off()
cat("\014")

Load libraries and data

Particularly, the weathercan library, which contains information on climate change and environmental variables from stations across Canada1.

Code
#borrar caché
#system("fc-cache -f -v")

#check R version
if(Sys.info()["sysname"]=="Windows"){
if (getRversion() != "4.4.1") { stop("Requiere versión de R 4.4.1. Actual: ", getRversion()) }
}
if(Sys.info()["sysname"]=="Linux"){
if (getRversion() != "4.4.1") { stop("Requiere versión de R 4.4.1. Actual: ", getRversion()) }
}
#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:
#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:

# install.packages(c("dplyr", #for data
#                    "tidyr", #for data
#                    "lubridate",  #for dates
#                    "openxlsx", #for excel files
#                    "rio", #for importing and exporting data
#                    "purrr", #for iterating in databases
#                    "devtools", #for external packages
#                    "DiagrammeR", #para visualizar DAG
#                    "dagitty",
#                    "ggdag",
#                    "ggplot2" #for graphics
#                    "kableExtra", #pretty tables
#                    "quarto", #for documents
#                    "geosphere" #for coordinates and classifying
#                    "geepack", #for regression
#                    "glmmTMB", #For GLMMs
#                    "DHARMa", #For residual diagnostics
#                    "car", #For hypothesis testing
#                    "brms", #Bayesian model
#                    "bayesplot",
#                    "loo",
#                    "Synth", #for synthetic control method
#                    "weathercan",#for weather data
#                    "sandwich", #cluster robust intervals
#                    "emmeans", #for predictions
#                    "gnm", #Conditional Poisson models
#                    "splines", #nonlinearity 
#                    "geeM", #negative binomial and more flexible GEE models
#                    "PanelMatch", #Matching technique with panel data
#                    "scpi" #control sintético
#                    "nixtlar", #for time series analysis and prediction
#                    "CausalImpact" #for time series causal impact
#                    "forecast" #for time series analysis prediction and decomposition
#                    ))
library(dplyr); library(lubridate); library(tidyverse); library(openxlsx); library(rio); library(purrr); library(dagitty); library(ggdag); library(kableExtra); library(geosphere); library(geepack); library(lme4); library(glmmTMB); library(DHARMa); library(car); library(brms); library(bayesplot); library(loo); library(Synth);  library(weathercan); library(sandwich); library(emmeans); library(gnm); library(splines); library(geeM); library(plm); library(PanelMatch); library(scpi); library(fect); library(nixtlar); library(CausalImpact); library(forecast); library(webshot)

Adjuntando el paquete: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Adjuntando el paquete: 'lubridate'
The following objects are masked from 'package:base':

    date, intersect, setdiff, union
Warning: package 'readr' was built under R version 4.4.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ forcats 1.0.0     ✔ stringr 1.5.1
✔ ggplot2 3.5.2     ✔ tibble  3.2.1
✔ purrr   1.0.4     ✔ tidyr   1.3.1
✔ readr   2.1.5     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

Adjuntando el paquete: 'dagitty'


The following object is masked from 'package:rio':

    convert



Adjuntando el paquete: 'ggdag'


The following object is masked from 'package:stats':

    filter



Adjuntando el paquete: 'kableExtra'


The following object is masked from 'package:dplyr':

    group_rows


Cargando paquete requerido: Matrix


Adjuntando el paquete: 'Matrix'


The following objects are masked from 'package:tidyr':

    expand, pack, unpack



Adjuntando el paquete: 'lme4'


The following object is masked from 'package:rio':

    factorize


This is DHARMa 0.4.7. For overview type '?DHARMa'. For recent changes, type news(package = 'DHARMa')

Cargando paquete requerido: carData


Adjuntando el paquete: 'car'


The following object is masked from 'package:purrr':

    some


The following object is masked from 'package:dplyr':

    recode


Cargando paquete requerido: Rcpp

Loading 'brms' package (version 2.22.0). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').


Adjuntando el paquete: 'brms'


The following object is masked from 'package:glmmTMB':

    lognormal


The following object is masked from 'package:lme4':

    ngrps


The following object is masked from 'package:stats':

    ar


This is bayesplot version 1.12.0

- Online documentation and vignettes at mc-stan.org/bayesplot

- bayesplot theme set to bayesplot::theme_default()

   * Does _not_ affect other ggplot2 plots

   * See ?bayesplot_theme_set for details on theme setting


Adjuntando el paquete: 'bayesplot'


The following object is masked from 'package:brms':

    rhat


This is loo version 2.8.0

- Online documentation and vignettes at mc-stan.org/loo

- As of v2.0.0 loo defaults to 1 core but we recommend using as many as possible. Use the 'cores' argument or set options(mc.cores = NUM_CORES) for an entire session. 

- Windows 10 users: loo may be very slow if 'mc.cores' is set in your .Rprofile file (see https://github.com/stan-dev/loo/issues/94).

##
## Synth Package: Implements Synthetic Control Methods.


## See https://web.stanford.edu/~jhain/synthpage.html for additional information.
Warning: package 'weathercan' was built under R version 4.4.3
As of v0.7.2, the `normals` column in `stations()` reflects whether or not there
are *any* normals available (not just the most recent).
Welcome to emmeans.
Caution: You lose important information if you filter this package's results.
See '? untidy'
Registered S3 method overwritten by 'lfe':
  method    from 
  nobs.felm broom

Adjuntando el paquete: 'plm'

The following objects are masked from 'package:dplyr':

    between, lag, lead


Adjuntando el paquete: 'PanelMatch'

The following object is masked from 'package:tidyr':

    extract

The following object is masked from 'package:stats':

    weights

Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2
Cargando paquete requerido: bsts
Cargando paquete requerido: BoomSpikeSlab
Cargando paquete requerido: Boom

Adjuntando el paquete: 'Boom'

The following objects are masked from 'package:brms':

    ddirichlet, rdirichlet

The following object is masked from 'package:stats':

    rWishart


Adjuntando el paquete: 'BoomSpikeSlab'

The following object is masked from 'package:stats':

    knots

Cargando paquete requerido: zoo

Adjuntando el paquete: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Cargando paquete requerido: xts

######################### Warning from 'xts' package ##########################
#                                                                             #
# The dplyr lag() function breaks how base R's lag() function is supposed to  #
# work, which breaks lag(my_xts). Calls to lag(my_xts) that you type or       #
# source() into this session won't work correctly.                            #
#                                                                             #
# Use stats::lag() to make sure you're not using dplyr::lag(), or you can add #
# conflictRules('dplyr', exclude = 'lag') to your .Rprofile to stop           #
# dplyr from breaking base R's lag() function.                                #
#                                                                             #
# Code in packages is not affected. It's protected by R's namespace mechanism #
# Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning.  #
#                                                                             #
###############################################################################

Adjuntando el paquete: 'xts'

The following objects are masked from 'package:dplyr':

    first, last


Adjuntando el paquete: 'bsts'

The following object is masked from 'package:BoomSpikeSlab':

    SuggestBurn

Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo 

Adjuntando el paquete: 'forecast'

The following object is masked from 'package:brms':

    ma
Code
#special repository indicated or the package
if(!require(weathercan)){
   install.packages("weathercan", 
                  repos = c("https://ropensci.r-universe.dev", "https://cloud.r-project.org")); library(weathercan)
  }

#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_

if(!require(bpmn)){devtools::install_github("bergant/bpmn")}
Cargando paquete requerido: bpmn
Code
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
sum_dates <- function(x){
 
  cbind.data.frame(
    min= as.Date(min(unclass(as.Date(x)), na.rm=T), origin = "1970-01-01"),
    p001= as.Date(quantile(unclass(as.Date(x)), .001, na.rm=T), origin = "1970-01-01"),
    p005= as.Date(quantile(unclass(as.Date(x)), .005, na.rm=T), origin = "1970-01-01"),
    p025= as.Date(quantile(unclass(as.Date(x)), .025, na.rm=T), origin = "1970-01-01"),
    p25= as.Date(quantile(unclass(as.Date(x)), .25, na.rm=T), origin = "1970-01-01"),
    p50= as.Date(quantile(unclass(as.Date(x)), .5, na.rm=T), origin = "1970-01-01"),
    p75= as.Date(quantile(unclass(as.Date(x)), .75, na.rm=T), origin = "1970-01-01"),
    p975= as.Date(quantile(unclass(as.Date(x)), .975, na.rm=T), origin = "1970-01-01"),
    p995= as.Date(quantile(unclass(as.Date(x)), .995, na.rm=T), origin = "1970-01-01"),
    p999= as.Date(quantile(unclass(as.Date(x)), .999, na.rm=T), origin = "1970-01-01"),
    max= as.Date(max(unclass(as.Date(x)), na.rm=T), origin = "1970-01-01")
  )
}
smd_bin <- function(x,y){
  z <- x*(1-x)
  t <- y*(1-y)
  k <- sum(z,t)
  l <- k/2
  
  return((x-y)/sqrt(l))
  
}

theme_custom_sjplot2 <- function(base_size = 12, base_family = "") {
  theme_minimal(base_size = base_size, base_family = base_family) +
    theme(
      # Text elements
      text = element_text(size = base_size, family = base_family),
      plot.title = element_text(face = "bold", hjust = 0.5, size = base_size * 1.2),
      plot.subtitle = element_text(hjust = 0.5, margin = margin(b = 10)),
      axis.title = element_text(size = base_size, face = "bold"),
      axis.text = element_text(size = base_size * 0.8),
      axis.text.x = element_text(angle = 0, hjust = 0.5, vjust = 0.5),
      axis.text.y = element_text(angle = 0, hjust = 1, vjust = 0.5),
      axis.title.x = element_text(margin = margin(t = 10)),
      axis.title.y = element_text(margin = margin(r = 10)),
      
      # Plot layout
      plot.margin = margin(t = 20, r = 20, b = 20, l = 20),
      panel.grid.major = element_line(color = "grey80"),
      panel.grid.minor = element_blank(),
      legend.position = "right",
      legend.text = element_text(size = base_size * 0.8),
      legend.title = element_text(size = base_size, face = "bold"),
      legend.background = element_rect(fill = "white", colour = NA),
      legend.box.background = element_rect(colour = "grey80", linetype = "solid"),
      legend.key = element_rect(fill = "white", colour = "white")
    )
}

#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
num_cores <- parallel::detectCores() -1
data.table::setDTthreads(threads = num_cores)#restore_after_fork = NULL, throttle = NULL)

#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_
#CONFIG #######################################################################
#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_

options(scipen=2) #display numbers rather scientific number


nixtlar::nixtla_client_setup(api_key = readLines(paste0(gsub("f1/","", getwd() ),"/key.txt"))[[2]])
Warning in readLines(paste0(gsub("f1/", "", getwd()), "/key.txt")): incomplete
final line found on 'H:/Mi unidad/PERSONAL
ANDRES/UCH_salud_publica/pasantia/f1/key.txt'
API key has been set for the current session.

Get the F1 race calendar 1978-2024. Since 2000 the race almost always falls on the second Sunday of June (seven times) or the first Sunday (five times). Some outliers occurred in 2006 (25 Jun), when the event was pushed two weeks later to balance the calendar; in 2022 (19 Jun) the event slipped a week because of the re-shuffled post-COVID schedule. In 2009 it was cancelled due to a commercial dispute, and in 2020-21, pandemic travel restrictions imposed the non-realization of the event2.

Code
races <- tibble::tribble(
  ~year, ~race_date,
  1978, "1978-10-08",
  1979, "1979-09-30",
  1980, "1980-09-28",
  1981, "1981-09-27",
  1982, "1982-06-13",
  1983, "1983-06-12",
  1984, "1984-06-17",
  1985, "1985-06-16",
  1986, "1986-06-15",
  1987, NA_character_,   # cancelada
  1988, "1988-06-12",
  1989, "1989-06-18",
  1990, "1990-06-10",
  1991, "1991-06-02",
  1992, "1992-06-14",
  1993, "1993-06-13",
  1994, "1994-06-12",
  1995, "1995-06-11",
  1996, "1996-06-16",
  1997, "1997-06-15",
  1998, "1998-06-07",
  1999, "1999-06-13",
  2000, "2000-06-18",
  2001, "2001-06-10",
  2002, "2002-06-09",
  2003, "2003-06-15",
  2004, "2004-06-13",
  2005, "2005-06-12",
  2006, "2006-06-25",
  2007, "2007-06-10",
  2008, "2008-06-08",
  2009, NA_character_,   # cancelada
  2010, "2010-06-13",
  2011, "2011-06-12",
  2012, "2012-06-10",
  2013, "2013-06-09",
  2014, "2014-06-08",
  2015, "2015-06-07",
  2016, "2016-06-12",
  2017, "2017-06-11",
  2018, "2018-06-10",
  2019, "2019-06-09",
  2020, NA_character_,   # cancelada
  2021, NA_character_,   # cancelada
  2022, "2022-06-19",
  2023, "2023-06-18",
  2024, "2024-06-09"
) %>% 
  mutate(race_date = as_date(race_date))

Metheorological variables

We created a named character vector called station_patterns as a lookup table where each short, convenient name (like trudeau or mctavish) is directly linked to the full, official name of a specific Canadian weather station from Environment and Climate Change Canada. 10 different weather stations are being identified. These stations represent a variety of locations, including a major international airport (trudeau), an urban center (mctavish), and various points across a broader geographic area (e.g., west, northwest, northeast of a specific island, and surrounding regions like Laval and the South Shore). This approach makes your code more readable and easier to maintain, as you can refer to complex station names using simple aliases, and any future changes to official names only require an update in this single, centralized location.

After 2025-06-12, we added 8 stations explicitly located in Longueuil (2), Trois-Rivières (1), Québec (1) and Sherbrooke (4).

Code
station_patterns <- c(
  trudeau          = "MONTREAL/PIERRE ELLIOTT TRUDEAU INTL",   # Dorval :contentReference[oaicite:0]{index=0}
  mctavish         = "MCTAVISH",                               # centro urbano :contentReference[oaicite:1]{index=1}
  ste_anne         = "STE-ANNE-DE-BELLEVUE 1",                 # extremo-oeste :contentReference[oaicite:2]{index=2}
  ste_genevieve    = "STE GENEVIEVE",                          # noroeste isla :contentReference[oaicite:3]{index=3}
  rdp              = "RIVIERE DES PRAIRIES",                   # noreste isla :contentReference[oaicite:4]{index=4}
  lave_auteuil     = "AUTEUIL",                                # Laval norte :contentReference[oaicite:5]{index=5}
  ste_therese      = "STE THERESE OUEST",                      # al N de Laval :contentReference[oaicite:6]{index=6}
  lave_dorothee    = "STE DOROTHEE",                           # Laval oeste (serie vigente)
  st_hubert        = "MONTREAL/ST-HUBERT A",                   # aeropuerto Longueuil :contentReference[oaicite:7]{index=7}
  la_prairie       = "LAPRAIRIE",                               # Rive-Sud suroeste :contentReference[oaicite:8]{index=8}
  vercheres        = "VERCHERES",
  st_amable        = "ST AMABLE"
)

#Before 2025-06-12, stations covers the urban areas of Laval, Montreal, and Longueuil 
#added missing stations explicitly located in:
#Trois-Rivières
#Québec
#Sherbrooke
#
station_patterns_rec <- c(
  station_patterns,
  trois_rivieres    = "TROIS RIVIERES AQUEDUC",    # Aqueduc Trois-Rivières (≈10 km from YRQ)
  quebec_airport    = "QUEBEC/JEAN LESAGE INTL",  # Québec City Airport
  sherbrooke_air    = "SHERBROOKE A",             # Sherbrooke Airport
  # sherbrooke_city = "SHERBROOKE",               # Sherbrooke urban center (if needed)
  lennoxville       = "LENNOXVILLE",              # Lennoxville (near Sherbrooke)
  vercheres         = "VERCHERES",                # Verchères (south shore, covers May 2019)
  st_amable         = "ST AMABLE",                # Saint-Amable (south shore)
  sawyerville_nord  = "SAWYERVILLE NORD",         # Sawyerville Nord (≤25 km from Sherbrooke A)
  bromptonville     = "BROMPTONVILLE",            # Bromptonville (≤25 km from Sherbrooke A)
  st_hubert2        = "MONTREAL/ST-HUBERT"        # New St-Hubert hourly automated station
)

We get a glimpse of stations, we got the daily measurements for each station.

Code
stations_df <- purrr::imap_dfr(
  station_patterns_rec,
  function(pattern, alias) {
    out <- stations_search(pattern) %>%           # busca por cadena
      filter(interval %in% c("day")) %>%  # prioriza estaciones operativas
      slice(1)                                    # toma la coincidencia más cercana
    if (nrow(out) == 0)
      stop(sprintf("No se encontró ninguna estación para «%s»", pattern), call. = FALSE)
    out %>% mutate(alias = alias) %>%             # añade el nombre “amistoso”
      select(alias, station_id, start, end, station_name)
  }
)
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available

We set up geographical information for 10 weather stations and 3 major urban centers, then calculates which of those 3 cities is geographically closest to each weather station (using Haversine distance). After this, we categorize stations based on proximity.

Code
# 1. Define your stations
stations <- data.frame(
  station = c(
    names(station_patterns)[1:10],
    "trois_rivieres", "quebec_airport", "sherbrooke_air", "lennoxville", "vercheres", "st_amable", "sawyerville_nord", 
"bromptonville", "st_hubert2"
  ),
  lat = c(
    45.470556, 45.500000, 45.430000, 45.500000, 45.700000,
    45.650000, 45.650000, 45.516667, 45.516667, 45.380000,
    46.350000, 46.791000, 45.433000, 45.366700, 45.76667, 45.65000, 45.36667, 45.48333, 45.5
  ),
  lon = c(
    -73.740833, -73.580000, -73.930000, -73.850000, -73.500000,
    -73.733300, -73.883300, -73.783333, -73.416667, -73.430000,
    -72.567000, -71.393000, -71.683000, -71.833300, -73.36667, -73.30000, -71.53333, -71.950000, -73.4
  )
)
 
# 2. Define the centroids
centroids <- data.frame(
  city = c("Montreal", "Laval", "Longueuil", "Trois-Rivieres", "Quebec", "Sherbrooke"),
  lat  = c(45.508888, 45.600000, 45.536945, 46.343239, 46.813878, 45.404476),
  lon  = c(-73.561668, -73.733000, -73.510712, -72.543283, -71.207981, -71.888351)
)

# 3. Compute distance matrix and assign nearest city
dist_mat <- distm(
  stations[, c("lon", "lat")],
  centroids[, c("lon", "lat")],
  fun = geosphere::distHaversine
)
stations$nearest <- centroids$city[apply(dist_mat, 1, which.min)]

stations_and_location<- 
stations_df |> 
  left_join(stations, by=c("alias"="station"))|> 
  mutate(mrc= case_when(
    nearest == "Laval" ~ 65,
    nearest == "Longueuil" ~ 58,
    nearest == "Montreal" ~ 66,
    nearest == "Quebec" ~ 23,
    nearest == "Sherbrooke" ~ 43,
    nearest == "Trois-Rivieres" ~ 371, T~ NA_real_
  ))


stations_and_location|> 
  filter(!alias %in% c("lave_dorothee", "ste_genevieve"))|>
  knitr::kable(caption = "Updated Stations with Nearest Cities")
Updated Stations with Nearest Cities
alias station_id start end station_name lat lon nearest mrc
trudeau 30165 2002 2025 MONTREAL/PIERRE ELLIOTT TRUDEAU INTL 45.47056 -73.74083 Laval 65
mctavish 10761 1994 2025 MCTAVISH 45.50000 -73.58000 Montreal 66
ste_anne 10873 1993 2025 STE-ANNE-DE-BELLEVUE 1 45.43000 -73.93000 Laval 65
rdp 5441 1973 2025 RIVIERE DES PRAIRIES 45.70000 -73.50000 Longueuil 58
lave_auteuil 5313 1983 2023 AUTEUIL 45.65000 -73.73330 Laval 65
ste_therese 5285 1961 2023 STE THERESE OUEST 45.65000 -73.88330 Laval 65
st_hubert 5490 1928 2015 MONTREAL/ST-HUBERT A 45.51667 -73.41667 Longueuil 58
la_prairie 5389 1963 2025 LAPRAIRIE 45.38000 -73.43000 Montreal 66
vercheres 5564 1963 2025 VERCHERES 45.76667 -73.36667 Longueuil 58
st_amable 5447 1980 2023 ST AMABLE 45.65000 -73.30000 Longueuil 58
trois_rivieres 5201 1974 2023 TROIS RIVIERES AQUEDUC 46.35000 -72.56700 Trois-Rivieres 371
quebec_airport 26892 1992 2025 QUEBEC/JEAN LESAGE INTL 46.79100 -71.39300 Quebec 23
sherbrooke_air 5530 1962 2016 SHERBROOKE A 45.43300 -71.68300 Sherbrooke 43
lennoxville 5397 1888 2025 LENNOXVILLE 45.36670 -71.83330 Sherbrooke 43
vercheres 5564 1963 2025 VERCHERES 45.76667 -73.36667 Longueuil 58
st_amable 5447 1980 2023 ST AMABLE 45.65000 -73.30000 Longueuil 58
sawyerville_nord 5526 1961 2025 SAWYERVILLE NORD 45.36667 -71.53333 Sherbrooke 43
bromptonville 5327 1957 2025 BROMPTONVILLE 45.48333 -71.95000 Sherbrooke 43
st_hubert2 48374 2009 2025 MONTREAL/ST-HUBERT 45.50000 -73.40000 Longueuil 58

STE GENEVIEVE and STE DOROTHEE were discarded because they did not coer the study period.

There are missing (“M”) values not well labelled as such.

For each F1 race from 1978:

  • took one of the 10 stations listed above
  • selected the period between May and September of each year
  • for different measurements, we calculated the median and the mean (not sure if this is useful if each observation is a daily measurement) of precipitations, maximum and minimum temperature, snow, etc.
Code
#weather_dl( 30165, start="1978-10-01", end="1978-10-15")
#skip givin NA if no data available for a year
#skip if there is no data for a given year

#vignette("flags", package = "weathercan")
get_window <- function(st_id, alias) {
  # Info de la estación
  station_info <- stations_df %>% filter(station_id == st_id)
  start_avail <- as_date(station_info$start)
  end_avail   <- as_date(station_info$end)

  races %>%
    #filter(!is.na(race_date)) %>%
    rowwise() %>%
    filter(year > 1999, year < 2023)%>% # The extra parenthesis was here
    mutate(
      range_start = make_date(year, 5, 1),#race_date - days(14),
      range_end   = make_date(year, 9, 30),#race_date+  days(14),
      data = list(
        tryCatch({
          df <- weather_dl(station_id = st_id,
                           start = range_start,
                           end   = range_end,
                           interval = "day") %>%
            group_by(date) %>%
            summarise(
              across(
                any_of(c(
                  "pressure", "rel_hum", "precip_amt",
                  "min_temp", "max_temp", "total_precip", "total_rain", "total_snow",
                  "temp", "temp_dew", "wind_chill", "wind_spd"
                )),
                list(
                  mean   = ~ mean(.x, na.rm = TRUE),
                  median = ~ median(.x, na.rm = TRUE)
                ),
                .names = "{.col}_{.fn}"
              )
            )
          df
        }, error = function(e) tibble())
      )
    ) %>%
    ungroup() %>%
    unnest(data) %>%
    mutate(station = alias)%>%
    relocate(station, date, race_date)
}
#2004-06-06
#2004-06-20
## 30165 10761 10873  3758  5441  5313  5285  5460  5490  5389  5201 26892  5530  5528  5397
## There are no data for station 5528, in this time range (2004-06-06 to 2004-06-20), for this interval (day), 
# so we skip it
test<- 
 weather_dl(station_id = 5441,#5460, #
           start = make_date(2022, 5, 1),#"1978-10-01",
           end   = make_date(2022, 9, 30),#"1978-10-15",
           interval = "day") |>
   group_by(date) |> 
  summarise(
    across(
      any_of(c(
        "pressure", "rel_hum", "precip_amt",
        "min_temp", "max_temp", "total_precip", "total_rain", "total_snow",
        "temp", "temp_dew", "wind_chill", "wind_spd"
      )),
      list(
        mean   = ~ mean(.x, na.rm = TRUE),
        median = ~ median(.x, na.rm = TRUE)
      ),
      .names = "{.col}_{.fn}"
    )
  )         
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Code
wx_all <- map2_dfr(setdiff(stations_df$station_id,c(3758, 5460)), setdiff(stations_df$alias,c("lave_dorothee", "ste_genevieve")), get_window) 
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 30165, in this time range (2000-05-01 to 2000-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/PIE…      30165 702S006     71183 WTQ    45.5 -73.7  32.1 Etc/…
2 QC    MONTREAL/PIE…      30165 702S006     71183 WTQ    45.5 -73.7  32.1 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 30165, in this time range (2001-05-01 to 2001-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/PIE…      30165 702S006     71183 WTQ    45.5 -73.7  32.1 Etc/…
2 QC    MONTREAL/PIE…      30165 702S006     71183 WTQ    45.5 -73.7  32.1 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 30165, in this time range (2002-05-01 to 2002-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/PIE…      30165 702S006     71183 WTQ    45.5 -73.7  32.1 Etc/…
2 QC    MONTREAL/PIE…      30165 702S006     71183 WTQ    45.5 -73.7  32.1 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 30165
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10761
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 10873
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5313, in this time range (2017-05-01 to 2017-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
2 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5313, in this time range (2018-05-01 to 2018-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
2 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5313, in this time range (2019-05-01 to 2019-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
2 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5313, in this time range (2020-05-01 to 2020-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
2 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5313, in this time range (2021-05-01 to 2021-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
2 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5313, in this time range (2022-05-01 to 2022-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
2 QC    AUTEUIL            5313 7020392        NA <NA>   45.6 -73.7    53 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2013-05-01 to 2013-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2014-05-01 to 2014-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2015-05-01 to 2015-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2017-05-01 to 2017-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2018-05-01 to 2018-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2019-05-01 to 2019-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2020-05-01 to 2020-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2021-05-01 to 2021-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5285, in this time range (2022-05-01 to 2022-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
2 QC    STE THERESE …       5285 7017755        NA <NA>   45.6 -73.9    61 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2005-05-01 to 2005-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2006-05-01 to 2006-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2007-05-01 to 2007-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2008-05-01 to 2008-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2012-05-01 to 2012-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2013-05-01 to 2013-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2014-05-01 to 2014-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2015-05-01 to 2015-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2016-05-01 to 2016-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2017-05-01 to 2017-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2018-05-01 to 2018-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2019-05-01 to 2019-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2020-05-01 to 2020-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2021-05-01 to 2021-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5490, in this time range (2022-05-01 to 2022-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
3 QC    MONTREAL/ST-…       5490 7027320     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5447, in this time range (2017-05-01 to 2017-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
2 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5447, in this time range (2018-05-01 to 2018-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
2 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5447, in this time range (2019-05-01 to 2019-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
2 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5447, in this time range (2020-05-01 to 2020-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
2 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5447, in this time range (2021-05-01 to 2021-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
2 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5447, in this time range (2022-05-01 to 2022-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
2 QC    ST AMABLE          5447 7026818        NA <NA>   45.7 -73.3  41.1 Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2010-05-01 to 2010-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2011-05-01 to 2011-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2012-05-01 to 2012-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2013-05-01 to 2013-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2014-05-01 to 2014-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2015-05-01 to 2015-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2017-05-01 to 2017-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2018-05-01 to 2018-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2019-05-01 to 2019-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2020-05-01 to 2020-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2021-05-01 to 2021-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5201, in this time range (2022-05-01 to 2022-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
2 QC    TROIS RIVIER…       5201 701HE63        NA <NA>   46.4 -72.6  54.9 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 26892
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 26892
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 26892
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5530
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5530, in this time range (2011-05-01 to 2011-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
2 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
3 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5530, in this time range (2017-05-01 to 2017-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
2 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
3 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5530, in this time range (2018-05-01 to 2018-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
2 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
3 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5530, in this time range (2019-05-01 to 2019-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
2 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
3 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5530, in this time range (2020-05-01 to 2020-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
2 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
3 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5530, in this time range (2021-05-01 to 2021-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
2 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
3 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 5530, in this time range (2022-05-01 to 2022-09-30), for this interval (day), 
Available Station Data:
# A tibble: 3 × 17
  prov  station_name station_id climate_id WMO_id TC_id   lat   lon  elev tz    
  <chr> <chr>             <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr> 
1 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
2 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
3 QC    SHERBROOKE A       5530 7028124     71610 YSC    45.4 -71.7  241. Etc/G…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 5397
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2000-05-01 to 2000-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2001-05-01 to 2001-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2002-05-01 to 2002-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2003-05-01 to 2003-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2004-05-01 to 2004-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2005-05-01 to 2005-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2006-05-01 to 2006-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2007-05-01 to 2007-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2008-05-01 to 2008-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
There are no data for station 48374, in this time range (2009-05-01 to 2009-09-30), for this interval (day), 
Available Station Data:
# A tibble: 2 × 17
  prov  station_name  station_id climate_id WMO_id TC_id   lat   lon  elev tz   
  <chr> <chr>              <dbl> <chr>       <dbl> <chr> <dbl> <dbl> <dbl> <chr>
1 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
2 QC    MONTREAL/ST-…      48374 7027329     71371 YHU    45.5 -73.4  27.4 Etc/…
# ℹ 7 more variables: interval <chr>, start <dbl>, end <dbl>, normals <lgl>,
#   normals_1991_2020 <lgl>, normals_1981_2010 <lgl>, normals_1971_2000 <lgl>
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Some variables have non-numeric values (spd_max_gust), for stations: 48374
  Replaced all non-numeric entries with NA. Use 'string_as = NULL' to keep as characters (see ?weather_dl).
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
The stations data frame hasn't been updated in over 4 weeks. Consider running `stations_dl()` to check for updates and make sure you have the most recent stations list available
Code
wx_all <- wx_all%>% 
    mutate(
    # define an indicator that is 1 if race_date ∈ [or3, or3 + 3 days], 0 otherwise
    study_window = as.integer(dplyr::between(date, race_date - days(35), race_date + days(35)))
  )
Code
#Select the relevant variables
wx_all_subset <- wx_all %>%
  dplyr::select(station, min_temp_mean, min_temp_median, max_temp_mean, max_temp_median, 
         total_precip_mean, total_precip_median, total_rain_mean, 
         total_rain_median, total_snow_mean, total_snow_median)

# Count missing values for station and variables
missing_counts <- wx_all_subset %>%
  pivot_longer(cols = -station, names_to = "variable", values_to = "value") %>%
  group_by(station, variable) %>%
  summarize(missing_count = sum(is.na(value) | is.nan(value)),n=n(), perc= missing_count/n, .groups = "drop")

# Graphic with facet_wrap by station
missing_counts|> 
  filter(variable %in% c(paste0( c("max_temp", "min_temp"), "_mean"), paste0( c("total_precip", "total_rain", "total_snow"), "_median")))|> 
ggplot(aes(x = variable, y = perc, fill = variable)) +
  geom_bar(stat = "identity") +
  facet_wrap(~ station, ncol = 4) +
  labs(x = "Variable", y = "Proportion of missing values") +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1),
        legend.position = "none")
Proportion of missing values by station and variable

Proportion of missing values by station and variable

Due to the high proportion of missing values, the variables total_rain_mean, total_rain_median, total_snow_mean, and total_snow_median were removed from the analysis. Likewise, the monitoring sites La Prairie (Montreal), Ste-Anne (Laval), and Trudeau (Laval) might be excluded from further analysis.

Here it is a glossary of the metrics selected3.

Variable Description Unit
max_temp Daily maximum air temperature: the highest dry-bulb temperature recorded during the 24-hour observation period. degrees Celsius (°C) ([Climate Data][1])
min_temp Daily minimum air temperature: the lowest dry-bulb temperature recorded during the 24-hour observation period. degrees Celsius (°C) ([Climate Data][1])
tot_precip Daily total precipitation: sum of the water equivalent of all liquid and solid precipitation (rain, snow, hail, etc.) accumulated over the day. millimetres (mm) ([Climate Data][1])
tot_precip_lag2 Two-day-lagged total precipitation: the value of tot_precip shifted backward by two days, useful for capturing antecedent moisture conditions in analyses. millimetres (mm) ([Climate Data][1])
Code
wx_summary_filt2002_22_all<- 
wx_all %>%
  filter(date>"1999-12-31", date<"2023-01-01")|> 
  select(station, date, race_date, year, min_temp_mean, min_temp_median, max_temp_mean, max_temp_median, 
         total_precip_mean, total_precip_median) %>%
  left_join(stations_and_location, by = c("station"="alias"), multiple="first") %>%
  group_by(date, nearest, mrc) %>%
  summarise(across(c("min_temp_mean", "min_temp_median", "max_temp_mean", "max_temp_median", "total_precip_mean", "total_precip_median"), ~ mean(.x, na.rm=T))) |> 
  ungroup()
`summarise()` has grouped output by 'date', 'nearest'. You can override using
the `.groups` argument.
Code
wx_summary_filt2002_22_all %>%
  ungroup() |> 
  select(
    nearest,
    min_temp_mean, min_temp_median,
    max_temp_mean, max_temp_median,
    total_precip_mean, total_precip_median
  ) %>%
  pivot_longer(
    cols = -nearest,
    names_to = "variable",
    values_to = "value"
  ) %>%
  group_by(nearest, variable) %>%
  summarise(
    missing_count = sum(is.na(value) | is.nan(value)),
    n             = n(),
    perc_missing  = scales::percent(missing_count / n, accuracy=.1),
    .groups       = "drop"
  ) %>%
  arrange(nearest, variable) -> missing_summary

missing_summary|> 
  head(20) %>%
  knitr::kable(caption = "Sample of missing values by station and variable")
Sample of missing values by station and variable
nearest variable missing_count n perc_missing
Laval max_temp_mean 6 3519 0.2%
Laval max_temp_median 6 3519 0.2%
Laval min_temp_mean 7 3519 0.2%
Laval min_temp_median 7 3519 0.2%
Laval total_precip_mean 3 3519 0.1%
Laval total_precip_median 3 3519 0.1%
Longueuil max_temp_mean 3 3519 0.1%
Longueuil max_temp_median 3 3519 0.1%
Longueuil min_temp_mean 2 3519 0.1%
Longueuil min_temp_median 2 3519 0.1%
Longueuil total_precip_mean 2 3519 0.1%
Longueuil total_precip_median 2 3519 0.1%
Montreal max_temp_mean 18 3519 0.5%
Montreal max_temp_median 18 3519 0.5%
Montreal min_temp_mean 12 3519 0.3%
Montreal min_temp_median 12 3519 0.3%
Montreal total_precip_mean 47 3519 1.3%
Montreal total_precip_median 47 3519 1.3%
Quebec max_temp_mean 24 3519 0.7%
Quebec max_temp_median 24 3519 0.7%
Code
wx_summary_filt2002_22_all |> 
  head(20) %>%
  knitr::kable(caption = "Sample of average values by station and date", digits=1, col.names = c("Date", "Nearest City", "MRC", "Min Temp (M°C)", "Min Temp (Mdn°C)", "Max Temp (M°C)", "Max Temp(Mdn°C)", "Precipitation (M mm)", "Precipitation (Mdn mm)"))
Sample of average values by station and date
Date Nearest City MRC Min Temp (M°C) Min Temp (Mdn°C) Max Temp (M°C) Max Temp(Mdn°C) Precipitation (M mm) Precipitation (Mdn mm)
2000-05-01 Laval 65 3.0 3.0 14.6 14.6 1.4 1.4
2000-05-01 Longueuil 58 0.8 0.8 14.7 14.7 1.6 1.6
2000-05-01 Montreal 66 4.0 4.0 14.7 14.7 2.5 2.5
2000-05-01 Quebec 23 -1.4 -1.4 13.3 13.3 4.0 4.0
2000-05-01 Sherbrooke 43 -3.3 -3.3 13.8 13.8 2.5 2.5
2000-05-01 Trois-Rivieres 371 -2.0 -2.0 13.0 13.0 2.7 2.7
2000-05-02 Laval 65 3.6 3.6 15.1 15.1 0.3 0.3
2000-05-02 Longueuil 58 3.5 3.5 14.8 14.8 0.0 0.0
2000-05-02 Montreal 66 5.3 5.3 14.6 14.6 0.5 0.5
2000-05-02 Quebec 23 1.1 1.1 12.8 12.8 0.0 0.0
2000-05-02 Sherbrooke 43 0.2 0.2 11.0 11.0 0.5 0.5
2000-05-02 Trois-Rivieres 371 2.0 2.0 13.0 13.0 0.0 0.0
2000-05-03 Laval 65 0.5 0.5 19.3 19.3 0.0 0.0
2000-05-03 Longueuil 58 -0.9 -0.9 19.5 19.5 0.0 0.0
2000-05-03 Montreal 66 2.5 2.5 18.4 18.4 0.0 0.0
2000-05-03 Quebec 23 -1.0 -1.0 16.5 16.5 0.0 0.0
2000-05-03 Sherbrooke 43 -2.7 -2.7 17.1 17.1 0.0 0.0
2000-05-03 Trois-Rivieres 371 -2.5 -2.5 17.0 17.0 0.0 0.0
2000-05-04 Laval 65 4.3 4.3 24.6 24.6 0.0 0.0
2000-05-04 Longueuil 58 3.7 3.7 24.6 24.6 0.6 0.6
Code
summary_vars <- c("min_temp_mean", "min_temp_median", "max_temp_mean",
                  "max_temp_median", "total_precip_mean", "total_precip_median")

# Realizar el resumen
summary_stats <- wx_summary_filt2002_22_all %>%
  group_by(nearest) %>%
  summarise(
    across(.cols = all_of(summary_vars),
           .fns = list(
             mean_sd = ~ sprintf("%.1f (%.1f)", mean(.x, na.rm = TRUE), sd(.x, na.rm = TRUE)),
             median_iqr = ~ sprintf("%.1f [%.1f, %.1f]",
                                    median(.x, na.rm = TRUE),
                                    quantile(.x, probs = 0.25, na.rm = TRUE),
                                    quantile(.x, probs = 0.75, na.rm = TRUE)),
             p5_p95_range = ~ sprintf("%.1f - %.1f",
                                      quantile(.x, probs = 0.05, na.rm = TRUE),
                                      quantile(.x, probs = 0.95, na.rm = TRUE))
           ),
           .names = "{.col}_{.fn}" # Naming convention for the new columns
    )
  )

summary_stats_long <- summary_stats %>%
  pivot_longer(
    cols = -nearest, # Todas las columnas excepto 'nearest'
    names_to = c("variable_original", "statistic_type"), # Crea dos nuevas columnas para los nombres
    names_sep = "_(?=[^_]*$)", # Separa por el último '_' para obtener la variable y el tipo de estadística
    values_to = "value" # La columna donde irán los valores formateados
  ) %>%
  # Opcional: Reordenar y limpiar los nombres de las variables/estadísticas
  mutate(
    variable_original = gsub("_(mean|median)$", "", variable_original), # Quitar _mean o _median del nombre de la variable
    statistic_type = case_when(
      statistic_type == "mean_sd" ~ "Mean (SD)",
      statistic_type == "median_iqr" ~ "Median [Q1, Q3]",
      statistic_type == "p5_p95_range" ~ "Range [P5, P95]",
      TRUE ~ statistic_type # Por si acaso hay otros tipos que no queremos renombrar
    )
  ) %>%
  # Opcional: Reordenar las columnas para mejor lectura
  relocate(nearest, variable_original, statistic_type, value) %>%
  arrange(nearest, variable_original, statistic_type) |> 
  mutate(variable_original= gsub("_p5_p95","",variable_original)) |> 
  mutate(statistic_type= gsub("sd","mean sd",statistic_type)) |> 
  mutate(statistic_type= gsub("range","90% range",statistic_type))

summary_stats_long |> 
  knitr::kable(caption = "Summary statistics for weather variables by nearest city",
               col.names = c("Nearest City", "Variable", "Statistic Type", "Value"),
               digits = 1, format.args = list(big.mark = ",")) %>%
  kableExtra::kable_classic() |> 
  kableExtra::scroll_box(width = "100%", height = "400px")
Summary statistics for weather variables by nearest city
Nearest City Variable Statistic Type Value
Laval max_temp_mean iqr 24.2 [20.2, 27.2]
Laval max_temp_mean mean sd 23.5 (5.1)
Laval max_temp_mean 90% range 14.3 - 30.9
Laval max_temp_median iqr 24.2 [20.2, 27.2]
Laval max_temp_median mean sd 23.5 (5.1)
Laval max_temp_median 90% range 14.3 - 30.9
Laval min_temp_mean iqr 13.2 [9.6, 16.4]
Laval min_temp_mean mean sd 12.8 (4.8)
Laval min_temp_mean 90% range 4.4 - 19.9
Laval min_temp_median iqr 13.2 [9.6, 16.4]
Laval min_temp_median mean sd 12.8 (4.8)
Laval min_temp_median 90% range 4.4 - 19.9
Laval total_precip_mean iqr 0.1 [0.0, 2.4]
Laval total_precip_mean mean sd 2.9 (6.6)
Laval total_precip_mean 90% range 0.0 - 15.4
Laval total_precip_median iqr 0.1 [0.0, 2.4]
Laval total_precip_median mean sd 2.9 (6.6)
Laval total_precip_median 90% range 0.0 - 15.4
Longueuil max_temp_mean iqr 24.4 [20.4, 27.3]
Longueuil max_temp_mean mean sd 23.7 (5.1)
Longueuil max_temp_mean 90% range 14.5 - 31.1
Longueuil max_temp_median iqr 24.4 [20.4, 27.3]
Longueuil max_temp_median mean sd 23.7 (5.1)
Longueuil max_temp_median 90% range 14.5 - 31.1
Longueuil min_temp_mean iqr 13.1 [9.4, 16.2]
Longueuil min_temp_mean mean sd 12.7 (4.8)
Longueuil min_temp_mean 90% range 4.0 - 19.9
Longueuil min_temp_median iqr 13.1 [9.4, 16.2]
Longueuil min_temp_median mean sd 12.7 (4.8)
Longueuil min_temp_median 90% range 4.0 - 19.9
Longueuil total_precip_mean iqr 0.1 [0.0, 2.9]
Longueuil total_precip_mean mean sd 3.1 (6.8)
Longueuil total_precip_mean 90% range 0.0 - 16.9
Longueuil total_precip_median iqr 0.1 [0.0, 2.9]
Longueuil total_precip_median mean sd 3.1 (6.8)
Longueuil total_precip_median 90% range 0.0 - 16.9
Montreal max_temp_mean iqr 24.3 [20.4, 27.4]
Montreal max_temp_mean mean sd 23.6 (5.1)
Montreal max_temp_mean 90% range 14.6 - 31.1
Montreal max_temp_median iqr 24.3 [20.4, 27.4]
Montreal max_temp_median mean sd 23.6 (5.1)
Montreal max_temp_median 90% range 14.6 - 31.1
Montreal min_temp_mean iqr 14.0 [10.3, 17.0]
Montreal min_temp_mean mean sd 13.5 (4.7)
Montreal min_temp_mean 90% range 5.1 - 20.4
Montreal min_temp_median iqr 14.0 [10.3, 17.0]
Montreal min_temp_median mean sd 13.5 (4.7)
Montreal min_temp_median 90% range 5.1 - 20.4
Montreal total_precip_mean iqr 0.0 [0.0, 2.8]
Montreal total_precip_mean mean sd 3.2 (7.2)
Montreal total_precip_mean 90% range 0.0 - 17.3
Montreal total_precip_median iqr 0.0 [0.0, 2.8]
Montreal total_precip_median mean sd 3.2 (7.2)
Montreal total_precip_median 90% range 0.0 - 17.3
Quebec max_temp_mean iqr 22.3 [18.2, 25.6]
Quebec max_temp_mean mean sd 21.7 (5.3)
Quebec max_temp_mean 90% range 12.2 - 29.4
Quebec max_temp_median iqr 22.3 [18.2, 25.6]
Quebec max_temp_median mean sd 21.7 (5.3)
Quebec max_temp_median 90% range 12.2 - 29.4
Quebec min_temp_mean iqr 10.6 [7.1, 13.7]
Quebec min_temp_mean mean sd 10.2 (4.7)
Quebec min_temp_mean 90% range 1.8 - 17.4
Quebec min_temp_median iqr 10.6 [7.1, 13.7]
Quebec min_temp_median mean sd 10.2 (4.7)
Quebec min_temp_median 90% range 1.8 - 17.4
Quebec total_precip_mean iqr 0.0 [0.0, 3.1]
Quebec total_precip_mean mean sd 3.5 (8.0)
Quebec total_precip_mean 90% range 0.0 - 18.7
Quebec total_precip_median iqr 0.0 [0.0, 3.1]
Quebec total_precip_median mean sd 3.5 (8.0)
Quebec total_precip_median 90% range 0.0 - 18.7
Sherbrooke max_temp_mean iqr 23.1 [19.2, 26.2]
Sherbrooke max_temp_mean mean sd 22.5 (5.1)
Sherbrooke max_temp_mean 90% range 13.1 - 29.9
Sherbrooke max_temp_median iqr 23.1 [19.2, 26.2]
Sherbrooke max_temp_median mean sd 22.5 (5.1)
Sherbrooke max_temp_median 90% range 13.1 - 29.9
Sherbrooke min_temp_mean iqr 10.8 [7.0, 14.2]
Sherbrooke min_temp_mean mean sd 10.4 (5.1)
Sherbrooke min_temp_mean 90% range 0.9 - 18.0
Sherbrooke min_temp_median iqr 10.8 [7.0, 14.2]
Sherbrooke min_temp_median mean sd 10.4 (5.1)
Sherbrooke min_temp_median 90% range 0.9 - 18.0
Sherbrooke total_precip_mean iqr 0.3 [0.0, 3.8]
Sherbrooke total_precip_mean mean sd 3.5 (6.8)
Sherbrooke total_precip_mean 90% range 0.0 - 17.5
Sherbrooke total_precip_median iqr 0.3 [0.0, 3.8]
Sherbrooke total_precip_median mean sd 3.5 (6.8)
Sherbrooke total_precip_median 90% range 0.0 - 17.5
Trois-Rivieres max_temp_mean iqr 23.0 [19.0, 26.0]
Trois-Rivieres max_temp_mean mean sd 22.5 (5.1)
Trois-Rivieres max_temp_mean 90% range 13.0 - 30.0
Trois-Rivieres max_temp_median iqr 23.0 [19.0, 26.0]
Trois-Rivieres max_temp_median mean sd 22.5 (5.1)
Trois-Rivieres max_temp_median 90% range 13.0 - 30.0
Trois-Rivieres min_temp_mean iqr 12.0 [8.0, 15.0]
Trois-Rivieres min_temp_mean mean sd 11.4 (5.2)
Trois-Rivieres min_temp_mean 90% range 2.0 - 19.5
Trois-Rivieres min_temp_median iqr 12.0 [8.0, 15.0]
Trois-Rivieres min_temp_median mean sd 11.4 (5.2)
Trois-Rivieres min_temp_median 90% range 2.0 - 19.5
Trois-Rivieres total_precip_mean iqr 0.0 [0.0, 3.2]
Trois-Rivieres total_precip_mean mean sd 3.3 (7.2)
Trois-Rivieres total_precip_mean 90% range 0.0 - 17.7
Trois-Rivieres total_precip_median iqr 0.0 [0.0, 3.2]
Trois-Rivieres total_precip_median mean sd 3.3 (7.2)
Trois-Rivieres total_precip_median 90% range 0.0 - 17.7

We chose to maintain the tot_precip variable as the average of the median precipitation through stations. The rest of variables are the average across stations.


Collisions database

We imported a Stata-formatted dataset named Allcollisions2000_22.summer.2.dta, storing it as the collisions data frame. This comprehensive dataset chronicles traffic collisions in Quebec from 2000 to 2022, with a specific focus on the summer months (May to September, roughly late spring to early autumn). It includes data from several key cities and census divisions (MRCs), such as Trois-Rivières (MRC 371) and Québec (MRC 23), which serve as control areas, alongside Laval (MRC 65), Montréal (MRC 66), Longueuil (MRC 58), and Sherbrooke (MRC 43), the latter also may act as a control.

Code
collisions<- 
rio::import(paste0(getwd(),"/_data/Allcollisions2000_22.summer.2.dta"))

#  The SAAQ dataset is considered complete for fatal collisions, but mild-injury counts can be under-reported.
# • Alcohol and speed flags reflect the police officer’s assessment; they are not mutually exclusive.
glimpse(collisions, width=80)
Rows: 17,520
Columns: 12
$ mrc              <dbl> 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 2…
$ stata_date       <date> 2000-05-01, 2000-05-02, 2000-05-03, 2000-05-04, 2000…
$ nb_collisions    <dbl> 21, 19, 24, 23, 21, 11, 28, 22, 25, 26, 23, 27, 16, 1…
$ alcohol          <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
$ velocidad        <dbl> 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0,…
$ nb_mort_c        <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,…
$ nb_blese_grave_c <dbl> 0, 0, 2, 0, 0, 1, 1, 2, 0, 2, 0, 0, 0, 0, 0, 1, 1, 0,…
$ nb_blese_leger_c <dbl> 3, 7, 2, 6, 8, 3, 9, 3, 4, 6, 4, 11, 5, 3, 3, 8, 2, 9…
$ nb_vehicules     <dbl> 38, 36, 47, 46, 43, 22, 52, 43, 48, 48, 47, 51, 28, 2…
$ year             <dbl> 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,…
$ month            <dbl> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,…
$ day_of_week      <dbl> 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5,…

Trois-Rivières (MRC 371) is absent from the database. That leaves us with Quebec (MRC 23), and possibly Sherbrooke (MRC 43) as the control cities.

Weimported the offset data form google sheets containing vehicle/license holder statistics by year and city. then, we joined with weather data and defined treatment/control grou based on MRC codes, createdmultiple exposure widows around race dates. Posteriorly, we added temporal variables (ISO week, year of day), we also generated treatment indicator (D). Lastly, for data quality assessment, we checked for duplicates in the dataset, identified missing dates, generated diagnostic tables showing row count discrepancies by MRC/year and specific missing dates in the collision database.

Code
#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:
#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:
invisible("Add offset")

labels <- c(
  "License holders by sex and age",
  "Vehicles in circulation by use and type",
  "Vehicles in circulation by use, type and vehicle age"
)

offsets_db<- rio::import("https://docs.google.com/spreadsheets/d/1znDbWVXO2A5uSKiVazQwFJKZcrrH-VZXnQsG-INBQ-w/gviz/tq?tqx=out:tsv&gid=819465529", skip=1, header=T) |> filter(MRC!="MRC")

offsets_db$ind <- c(rep("license_holders_sex_age",5), rep(NA, 2), rep("vehicles_use_type",5), rep(NA, 2), rep("vehicles_use_type_vehicle_age", 5))

offsets_db<- dplyr::select(offsets_db, EQUALS, MRC, ind, everything())|>
                filter(!is.na(`2000`))|>
                pivot_longer(cols= c("2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", 
"2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022"), names_to = "year")|>
  pivot_wider(names_from=ind, values_from=value)|> 
  mutate(year= as.numeric(year), EQUALS=ifelse(EQUALS=="Longueiuil", "Longueuil", EQUALS))
  


#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:
#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:#:

invisible("2025-06-25: missing data in weather variables")
# filter(wx_summary_filt2002_22_all, dplyr::between(date,as.Date("2006-09-24"), as.Date("2006-09-30")), nearest=="Sherbrooke")
# filter(wx_summary_filt2002_22_all, dplyr::between(date,as.Date("2019-05-01"), as.Date("2019-05-31")), nearest=="Longueuil")

wx_summary_filt2002_22_all$date_num <- unclass(wx_summary_filt2002_22_all$date)

collisions_weather<- 
collisions|>
  mutate(date_num= unclass(stata_date))|> 
  left_join(wx_summary_filt2002_22_all, by=c("date_num"="date_num", "mrc"="mrc"))|> 
  group_by(mrc, date)|> 
  arrange(mrc, date)|>  
  mutate(lag_2_prec_median= lag(total_precip_median, n=2))|> 
  ungroup()|>
  mutate(tr_contr=ifelse(mrc %in% c(371, 23), "control", "treatment"))|>
  mutate(tr_contr_sens=ifelse(mrc %in% c(371, 23, 43), "control", "treatment"))|>  #adding Sherbrook
  left_join(races, by="year")|>
  #2025-06-25. missing weather variables for Longueuil
  #select(year, date, mrc, nearest, date_num)|> #2025-06-25= 2006 43 2006-09-24 to 2006-09-30; 2019 58 2019-05-01 to 2019-05-31
  mutate(date_num= unclass(date))|>
  left_join(offsets_db, by= c("nearest"="EQUALS", "year"="year"))|>
  mutate(
    exposure          = case_when(
      date_num <= (unclass(race_date) - 2) &    # t0-2
      date_num <= (unclass(race_date) + 3) ~ 1, # t+3
      TRUE ~ 0
    ),
    exposure_alt7     = case_when(
      date_num <= (unclass(race_date) - 2) &    # t0-2
      date_num <= (unclass(race_date) + 7) ~ 1, # t+7
      TRUE ~ 0
    ),
    exposure_off      = case_when(
      date_num <= (unclass(race_date)) &        # t0
      date_num <= (unclass(race_date) + 3) ~ 1, # t+3
      TRUE ~ 0
    ),
    exposure_alt7_off = case_when(
      date_num <= (unclass(race_date)) &        # t0
      date_num <= (unclass(race_date) + 7) ~ 1, # t+7
      TRUE ~ 0
    )
  )|>
  mutate(
    week_iso            = isoweek(stata_date),
    year_f             = factor(year),
    mrc_f              = factor(mrc),
    #exposure          = factor(exposure, levels = c(0, 1)),
    iso_yday           = yday(stata_date),
    log_veh            = log(nb_vehicules + 1),  # adding 1 to avoid log(0)
    D                  = ifelse(tr_contr == "treatment" & exposure == 1, 1, 0),
    D_sens             = ifelse(tr_contr_sens == "treatment" & exposure == 1, 1, 0),
    D7                 = ifelse(tr_contr == "treatment" & exposure_alt7 == 1, 1, 0),
    D7_sens            = ifelse(tr_contr_sens == "treatment" & exposure_alt7 == 1, 1, 0),
    D_off              = ifelse(tr_contr == "treatment" & exposure_off == 1, 1, 0),
    D_sens_off         = ifelse(tr_contr_sens == "treatment" & exposure_off == 1, 1, 0),
    D7_off             = ifelse(tr_contr == "treatment" & exposure_alt7_off == 1, 1, 0),
    D7_sens_off        = ifelse(tr_contr_sens == "treatment" & exposure_alt7_off == 1, 1, 0)
  )|>
  left_join(offsets_db, by=c("year", "MRC", "license_holders_sex_age",
    "vehicles_use_type", "vehicles_use_type_vehicle_age"))

cat("Duplicates?\n")
collisions_weather |>
  mutate(date = as.Date(stata_date)) |>
  filter(month(date) %in% 5:9) |>
  count(mrc, year, date) |>
  filter(n > 1)

cat("How many rows the database should have approx?\n")
23*length(unique(collisions_weather$mrc))*as.numeric(difftime(as.Date("2000-09-30"),as.Date("2000-05-01"), "days"))

cat("What we have \n")
nrow(collisions_weather)

cat("What we should have \n")
weather_filled <- collisions_weather |>
  mutate(rn= row_number()) |> 
mutate(date = as.Date(iso_yday - 1,
                      origin = paste0(year, "-01-01"))) |>
    filter(month(date) %in% 5:9) |>
    group_by(mrc, year) |>
    complete(
        date = seq.Date(min(date), max(date), by = "day")
    ) |>
    ungroup()
nrow(weather_filled)

invisible("Filled database has more rows")
orig_db <- 
  collisions_weather |> group_by(mrc, year) |> summarise(n=n(),.groups="drop")
proc_db<- 
weather_filled |> group_by(mrc, year) |> summarise(n=n(),.groups="drop")

orig_db |> 
  left_join(proc_db, by=c("mrc", "year"))|> 
    filter(n.x!=n.y) |> 
  rename("original"="n.x", "processed"="n.y")|> 
   knitr::kable(caption="Number of by MRC and year",
               col.names = c("MRC","Year", "Original DB", "Processed-dates DB")) |> 
  kableExtra::kable_classic() |> 
  kableExtra::scroll_box(width="100%", height="200px") 

present_dates <- collisions_weather |>
  mutate(date = as.Date(stata_date)) |>
  filter(month(date) %in% 5:9) |>
  select(mrc, year, date)

weather_filled |>
  anti_join(present_dates, by = c("mrc", "year", "date")) |>
  arrange(mrc, year, date) |> 
  select(mrc, date) |> 
  knitr::kable(caption="Missing Dates in Collisions Database",
               col.names = c("MRC", "Dates")) |> 
  kableExtra::kable_classic() |> 
  kableExtra::scroll_box(width="100%", height="200px")
Duplicates?
# A tibble: 0 × 4
# ℹ 4 variables: mrc <dbl>, year <dbl>, date <date>, n <int>
How many rows the database should have approx?
[1] 17480
What we have 
[1] 17520
What we should have 
[1] 17594
Number of by MRC and year
MRC Year Original DB Processed-dates DB
23 2020 152 153
43 2001 151 153
43 2005 152 153
43 2006 152 153
43 2010 151 153
43 2012 152 153
43 2013 151 153
43 2014 150 153
43 2015 151 153
43 2016 146 153
43 2017 146 153
43 2018 146 153
43 2019 143 152
43 2020 143 153
43 2021 144 153
43 2022 148 153
58 2000 152 153
58 2020 152 153
65 2000 152 153
65 2020 151 153
Missing Dates in Collisions Database
MRC Dates
23 2020-05-10
43 2001-07-02
43 2001-09-19
43 2005-05-15
43 2006-09-17
43 2010-05-09
43 2010-09-06
43 2012-05-17
43 2013-08-03
43 2013-09-22
43 2014-07-20
43 2014-08-16
43 2014-09-07
43 2015-06-21
43 2015-08-09
43 2016-05-10
43 2016-05-25
43 2016-06-06
43 2016-06-29
43 2016-08-17
43 2016-08-18
43 2016-09-26
43 2017-05-30
43 2017-08-06
43 2017-08-08
43 2017-08-18
43 2017-08-24
43 2017-09-04
43 2017-09-24
43 2018-05-06
43 2018-07-18
43 2018-07-23
43 2018-08-02
43 2018-08-07
43 2018-08-29
43 2018-09-01
43 2019-05-03
43 2019-05-07
43 2019-05-11
43 2019-06-05
43 2019-07-22
43 2019-07-24
43 2019-08-14
43 2019-09-05
43 2019-09-22
43 2020-05-02
43 2020-05-03
43 2020-05-05
43 2020-05-06
43 2020-05-10
43 2020-06-01
43 2020-06-10
43 2020-07-22
43 2020-07-23
43 2020-09-25
43 2021-05-02
43 2021-05-17
43 2021-05-23
43 2021-06-23
43 2021-07-11
43 2021-07-18
43 2021-08-01
43 2021-08-16
43 2021-09-12
43 2022-05-09
43 2022-05-23
43 2022-07-11
43 2022-08-09
43 2022-09-05
58 2000-08-27
58 2020-05-23
65 2000-08-21
65 2020-05-04
65 2020-05-10

Given that there were some missing dates, we added the assuming cero counts in these days.

We also interpolated linearly missing values in weather variables.

Code
collisions_weather_corr<- 
collisions |>
  mutate(rn= row_number())|> 
  #2025-06-13: added missing rows manually
  mutate(date = as.Date(yday(stata_date) - 1,
                        origin = paste0(year, "-01-01")))|>
      filter(month(date) %in% 5:9) |>
      group_by(mrc, year) |>
      complete(
          date = seq.Date(min(date), max(date), by = "day")
      )|>
      ungroup()|>
    mutate(
    across(
      c(nb_collisions, alcohol, velocidad,
        nb_mort_c, nb_blese_grave_c, nb_blese_leger_c,
        nb_vehicules),
      ~ if_else(is.na(stata_date), 0, .x)
    )
  )|> 
  dplyr::select(-month, -day_of_week, -stata_date)|> 
  mutate(date_num= unclass(date))|> 
  left_join(wx_summary_filt2002_22_all, by=c("date_num"="date_num", "mrc"="mrc"))|> 
  rename("date"="date.x")|> 
  group_by(mrc, date)|> 
  arrange(mrc, date)|>  
  ungroup()|> 
  mutate(tr_contr=ifelse(mrc %in% c(371, 23), "control", "treatment")) |>
  mutate(tr_contr_sens=ifelse(mrc %in% c(371, 23, 43), "control", "treatment"))|>  #adding Sherbrook
  left_join(races, by="year")|>
  #2025-06-25. missing weather variables for Longueuil
  #select(year, date, mrc, nearest, date_num)|> #2025-06-25= 2006 43 2006-09-24 to 2006-09-30; 2019 58 2019-05-01 to 2019-05-31
  mutate(date_num= unclass(date))|>
  left_join(offsets_db, by= c("nearest"="EQUALS", "year"="year"))|>  
  mutate(
    exposure      = coalesce(
      as.integer(dplyr::between(date, race_date - days(2),
                                 race_date + days(3))), 0L),
    exposure_alt7 = coalesce(
      as.integer(dplyr::between(date, race_date - days(2),
                                 race_date + days(7))), 0L),
    exposure_off  = coalesce(
      as.integer(dplyr::between(date, race_date,
                             race_date + days(3))), 0L),
    exposure_alt7_off = coalesce(
      as.integer(dplyr::between(date, race_date,
                             race_date + days(7))), 0L)
  )|>
  mutate(
    week_iso            = isoweek(date),
    year_f             = factor(year),
    mrc_f              = factor(mrc),
    exposure           = factor(exposure, levels = c(0, 1)),
    iso_yday           = yday(date),
    log_veh            = log(nb_vehicules + 1),  # adding 1 to avoid log(0)
    D                  = ifelse(tr_contr == "treatment" & exposure == 1, 1, 0),
    D_sens             = ifelse(tr_contr_sens == "treatment" & exposure == 1, 1, 0),
    D7                 = ifelse(tr_contr == "treatment" & exposure_alt7 == 1, 1, 0),
    D7_sens            = ifelse(tr_contr_sens == "treatment" & exposure_alt7 == 1, 1, 0),
    D_off              = ifelse(tr_contr == "treatment" & exposure_off == 1, 1, 0),
    D_sens_off         = ifelse(tr_contr_sens == "treatment" & exposure_off == 1, 1, 0),
    D7_off             = ifelse(tr_contr == "treatment" & exposure_alt7_off == 1, 1, 0),
    D7_sens_off        = ifelse(tr_contr_sens == "treatment" & exposure_alt7_off == 1, 1, 0)
  )|>
  group_by(mrc, year)|>
   arrange(date, .by_group = TRUE)|>
  mutate(across(
    c(min_temp_mean, min_temp_median, max_temp_mean, max_temp_median, 
total_precip_mean, total_precip_median),           # <- weather variables
    ~ zoo::na.approx(.x, x = date, na.rm = FALSE, rule = 2),
    .names = "{.col}_lin"                        # create *_lin instead overwriting
  ))|>
  ungroup()


if(filter(collisions_weather_corr, is.na(license_holders_sex_age)|is.na(vehicles_use_type)|is.na(vehicles_use_type_vehicle_age))|> nrow()){
  stop("Missing data in offsets")
  }


cat("Check the rows left after discarding missing observations in weather variables (not interpolated ones)\n")
collisions_weather_corr |>  filter(!is.na(min_temp_mean), !is.na(max_temp_mean), !is.na(total_precip_mean)) |> 
  nrow()

cat("Added the Lag precipitation mean (2 days) by MRC and year:\n")
collisions_weather_corr$lag_2_prec_median_lin <- 
collisions_weather_corr|> 
    group_by(mrc, year)|> 
    mutate(total_precip_median_lin_lag2 = dplyr::lag(total_precip_median_lin, 2, order_by = iso_yday))|> 
    ungroup()|>
    pull(total_precip_median_lin_lag2) 

if(
identical(collisions_weather_corr$total_precip_median_lin, collisions_weather_corr$lag_2_prec_median_lin)
){stop("The variable was not lagged")}

summary(collisions_weather_corr$lag_2_prec_median_lin)

cat("Lag precipitation mean (2 days) by MRC and year:\n")
table(is.na(collisions_weather_corr$lag_2_prec_median_lin))

cat("Lag precipitation mean, range of missing days:\n")
if(collisions_weather_corr|>  filter(is.na(lag_2_prec_median_lin)) |> nrow()>0){
collisions_weather_corr|>  filter(is.na(lag_2_prec_median_lin))|> dplyr::select(mrc, year, iso_yday)|> summarise(max=max(iso_yday), min= min(iso_yday))
}
cat("There ara no missing values\n")

cat("Added the cluster variable by MRC and year:\n")
collisions_weather_corr$cluster<- interaction(collisions_weather_corr$year, collisions_weather_corr$mrc)

cat("Add moving 3-day moving average\n")
Mean <- function(x) if (sum(!is.na(x)) >= 2) mean(x, na.rm = TRUE) else NA
#prior x elements (list(-seq(x)))
roll <- function(x)  zoo::rollapply(x, list(-seq(3)), Mean, fill = NA, partial = TRUE)
collisions_weather_corr <- 
transform(collisions_weather_corr, mov_ave_velocidad = ave(velocidad, cluster, FUN = roll))

cat("We generated the moving average of high-speed collisions, rounding to 0 decimals, and imputing the first two values (MRC-year) with the third value\n")
collisions_weather_corr<- 
collisions_weather_corr|> 
  dplyr::arrange(mrc, year, iso_yday)|> 
  #dplyr::select(mrc, year, cluster, iso_yday, velocidad, mov_ave_velocidad)|> 
  #filter(mrc!=23)|> 
    dplyr::group_by(cluster)|> 
    dplyr::mutate(
        third_value = nth(na.omit(mov_ave_velocidad), 1),
        mov_ave_velocidad = ifelse(is.na(mov_ave_velocidad), third_value, mov_ave_velocidad)
    )|>
    dplyr::select(-third_value)|> 
  dplyr::mutate(mov_ave_velocidad= round(mov_ave_velocidad, 0))|> 
  ungroup()


cat("Imputed with the value of the third period\n")
collisions_weather_corr$lag_2_prec_median_lin_imp <- 
collisions_weather_corr|>
    group_by(cluster)|>
    mutate(
        third_value = nth(na.omit(lag_2_prec_median_lin), 1),
        lag_2_prec_median_lin_imp = ifelse(is.na(lag_2_prec_median_lin), third_value, lag_2_prec_median_lin)
    )|>
    dplyr::select(-third_value)|>
    ungroup()|>
    pull(lag_2_prec_median_lin_imp)
if(
identical(collisions_weather_corr$lag_2_prec_median_lin, collisions_weather_corr$lag_2_prec_median_lin_imp)
){stop("The variable was not imputed")}
if(
identical(collisions_weather_corr$total_precip_median_lin, collisions_weather_corr$lag_2_prec_median_lin_imp)
){stop("The variable was not lagged")}


cat("Missing in imputed values of 2-day lagged precipitations\n")
collisions_weather_corr|> 
    filter(is.na(lag_2_prec_median_lin_imp))|> dplyr::select(mrc, year, iso_yday) |> nrow()

invisible("All are the first ranges")

cat("MRCs treated and controls and days of exposure:\n")
table(collisions_weather_corr$tr_contr, collisions_weather_corr$exposure)
cat("MRCs treated and controls and days of exposure(+ Sherbrooke as control):\n")
table(collisions_weather_corr$tr_contr_sens, collisions_weather_corr$exposure)

cat("Added the time variable: year and standardized day in the year\n")
collisions_weather_corr$time_id <- with(collisions_weather_corr, paste0(year_f, "_", iso_yday))


xtabs(~ year+mrc+tr_contr + exposure, data = collisions_weather_corr)|> 
  data.frame()|>
  filter(
    case_when(mrc%in% c(43, 58, 65, 66)& tr_contr=="control"& exposure==0~F,
    mrc%in% c(43, 58, 65, 66)& tr_contr=="control"& exposure==1~F,
    mrc== 23 & tr_contr=="treatment"& exposure==0~F,
    mrc== 23 & tr_contr=="treatment"& exposure==1~F,
                   T~T)) |> 
  arrange(tr_contr, mrc, year, exposure) |> 
  data.frame()|> 
  knitr::kable(caption="Number of observations by treatment status, MRC, year and exposure",
               col.names = c("Year", "MRC", "Control/Treated cities", "Days of exposure", "Observations"))|> 
  kableExtra::kable_classic() |> 
  kableExtra::scroll_box(width="100%", height="400px")

table(collisions_weather_corr$cluster, collisions_weather_corr$tr_contr) |> data.frame()|> 
  filter(Freq>0)|>
  knitr::kable(caption="Number of observations by MRC and year",
               col.names = c("MRC-Year", "Control/Treated cities", "Observations"))|> 
  kableExtra::kable_classic()|> 
  kableExtra::scroll_box(width="100%", height="400px")
Check the rows left after discarding missing observations in weather variables (not interpolated ones)
[1] 17489
Added the Lag precipitation mean (2 days) by MRC and year:
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
   0.00    0.00    0.10    3.22    3.00  108.50     230 
Lag precipitation mean (2 days) by MRC and year:

FALSE  TRUE 
17364   230 
Lag precipitation mean, range of missing days:
# A tibble: 1 × 2
    max   min
  <dbl> <dbl>
1   123   121
There ara no missing values
Added the cluster variable by MRC and year:
Add moving 3-day moving average
We generated the moving average of high-speed collisions, rounding to 0 decimals, and imputing the first two values (MRC-year) with the third value
Imputed with the value of the third period
Missing in imputed values of 2-day lagged precipitations
[1] 0
MRCs treated and controls and days of exposure:
           
                0     1
  control    3399   120
  treatment 13595   480
MRCs treated and controls and days of exposure(+ Sherbrooke as control):
           
                0     1
  control    6797   240
  treatment 10197   360
Added the time variable: year and standardized day in the year
Number of observations by treatment status, MRC, year and exposure
Year MRC Control/Treated cities Days of exposure Observations
2000 23 control 0 147
2000 23 control 1 6
2001 23 control 0 147
2001 23 control 1 6
2002 23 control 0 147
2002 23 control 1 6
2003 23 control 0 147
2003 23 control 1 6
2004 23 control 0 147
2004 23 control 1 6
2005 23 control 0 147
2005 23 control 1 6
2006 23 control 0 147
2006 23 control 1 6
2007 23 control 0 147
2007 23 control 1 6
2008 23 control 0 147
2008 23 control 1 6
2009 23 control 0 153
2009 23 control 1 0
2010 23 control 0 147
2010 23 control 1 6
2011 23 control 0 147
2011 23 control 1 6
2012 23 control 0 147
2012 23 control 1 6
2013 23 control 0 147
2013 23 control 1 6
2014 23 control 0 147
2014 23 control 1 6
2015 23 control 0 147
2015 23 control 1 6
2016 23 control 0 147
2016 23 control 1 6
2017 23 control 0 147
2017 23 control 1 6
2018 23 control 0 147
2018 23 control 1 6
2019 23 control 0 147
2019 23 control 1 6
2020 23 control 0 153
2020 23 control 1 0
2021 23 control 0 153
2021 23 control 1 0
2022 23 control 0 147
2022 23 control 1 6
2000 43 treatment 0 147
2000 43 treatment 1 6
2001 43 treatment 0 147
2001 43 treatment 1 6
2002 43 treatment 0 147
2002 43 treatment 1 6
2003 43 treatment 0 147
2003 43 treatment 1 6
2004 43 treatment 0 147
2004 43 treatment 1 6
2005 43 treatment 0 147
2005 43 treatment 1 6
2006 43 treatment 0 147
2006 43 treatment 1 6
2007 43 treatment 0 147
2007 43 treatment 1 6
2008 43 treatment 0 147
2008 43 treatment 1 6
2009 43 treatment 0 153
2009 43 treatment 1 0
2010 43 treatment 0 147
2010 43 treatment 1 6
2011 43 treatment 0 147
2011 43 treatment 1 6
2012 43 treatment 0 147
2012 43 treatment 1 6
2013 43 treatment 0 147
2013 43 treatment 1 6
2014 43 treatment 0 147
2014 43 treatment 1 6
2015 43 treatment 0 147
2015 43 treatment 1 6
2016 43 treatment 0 147
2016 43 treatment 1 6
2017 43 treatment 0 147
2017 43 treatment 1 6
2018 43 treatment 0 147
2018 43 treatment 1 6
2019 43 treatment 0 146
2019 43 treatment 1 6
2020 43 treatment 0 153
2020 43 treatment 1 0
2021 43 treatment 0 153
2021 43 treatment 1 0
2022 43 treatment 0 147
2022 43 treatment 1 6
2000 58 treatment 0 147
2000 58 treatment 1 6
2001 58 treatment 0 147
2001 58 treatment 1 6
2002 58 treatment 0 147
2002 58 treatment 1 6
2003 58 treatment 0 147
2003 58 treatment 1 6
2004 58 treatment 0 147
2004 58 treatment 1 6
2005 58 treatment 0 147
2005 58 treatment 1 6
2006 58 treatment 0 147
2006 58 treatment 1 6
2007 58 treatment 0 147
2007 58 treatment 1 6
2008 58 treatment 0 147
2008 58 treatment 1 6
2009 58 treatment 0 153
2009 58 treatment 1 0
2010 58 treatment 0 147
2010 58 treatment 1 6
2011 58 treatment 0 147
2011 58 treatment 1 6
2012 58 treatment 0 147
2012 58 treatment 1 6
2013 58 treatment 0 147
2013 58 treatment 1 6
2014 58 treatment 0 147
2014 58 treatment 1 6
2015 58 treatment 0 147
2015 58 treatment 1 6
2016 58 treatment 0 147
2016 58 treatment 1 6
2017 58 treatment 0 147
2017 58 treatment 1 6
2018 58 treatment 0 147
2018 58 treatment 1 6
2019 58 treatment 0 147
2019 58 treatment 1 6
2020 58 treatment 0 153
2020 58 treatment 1 0
2021 58 treatment 0 153
2021 58 treatment 1 0
2022 58 treatment 0 147
2022 58 treatment 1 6
2000 65 treatment 0 147
2000 65 treatment 1 6
2001 65 treatment 0 147
2001 65 treatment 1 6
2002 65 treatment 0 147
2002 65 treatment 1 6
2003 65 treatment 0 147
2003 65 treatment 1 6
2004 65 treatment 0 147
2004 65 treatment 1 6
2005 65 treatment 0 147
2005 65 treatment 1 6
2006 65 treatment 0 147
2006 65 treatment 1 6
2007 65 treatment 0 147
2007 65 treatment 1 6
2008 65 treatment 0 147
2008 65 treatment 1 6
2009 65 treatment 0 153
2009 65 treatment 1 0
2010 65 treatment 0 147
2010 65 treatment 1 6
2011 65 treatment 0 147
2011 65 treatment 1 6
2012 65 treatment 0 147
2012 65 treatment 1 6
2013 65 treatment 0 147
2013 65 treatment 1 6
2014 65 treatment 0 147
2014 65 treatment 1 6
2015 65 treatment 0 147
2015 65 treatment 1 6
2016 65 treatment 0 147
2016 65 treatment 1 6
2017 65 treatment 0 147
2017 65 treatment 1 6
2018 65 treatment 0 147
2018 65 treatment 1 6
2019 65 treatment 0 147
2019 65 treatment 1 6
2020 65 treatment 0 153
2020 65 treatment 1 0
2021 65 treatment 0 153
2021 65 treatment 1 0
2022 65 treatment 0 147
2022 65 treatment 1 6
2000 66 treatment 0 147
2000 66 treatment 1 6
2001 66 treatment 0 147
2001 66 treatment 1 6
2002 66 treatment 0 147
2002 66 treatment 1 6
2003 66 treatment 0 147
2003 66 treatment 1 6
2004 66 treatment 0 147
2004 66 treatment 1 6
2005 66 treatment 0 147
2005 66 treatment 1 6
2006 66 treatment 0 147
2006 66 treatment 1 6
2007 66 treatment 0 147
2007 66 treatment 1 6
2008 66 treatment 0 147
2008 66 treatment 1 6
2009 66 treatment 0 153
2009 66 treatment 1 0
2010 66 treatment 0 147
2010 66 treatment 1 6
2011 66 treatment 0 147
2011 66 treatment 1 6
2012 66 treatment 0 147
2012 66 treatment 1 6
2013 66 treatment 0 147
2013 66 treatment 1 6
2014 66 treatment 0 147
2014 66 treatment 1 6
2015 66 treatment 0 147
2015 66 treatment 1 6
2016 66 treatment 0 147
2016 66 treatment 1 6
2017 66 treatment 0 147
2017 66 treatment 1 6
2018 66 treatment 0 147
2018 66 treatment 1 6
2019 66 treatment 0 147
2019 66 treatment 1 6
2020 66 treatment 0 153
2020 66 treatment 1 0
2021 66 treatment 0 153
2021 66 treatment 1 0
2022 66 treatment 0 147
2022 66 treatment 1 6
Number of observations by MRC and year
MRC-Year Control/Treated cities Observations
2000.23 control 153
2001.23 control 153
2002.23 control 153
2003.23 control 153
2004.23 control 153
2005.23 control 153
2006.23 control 153
2007.23 control 153
2008.23 control 153
2009.23 control 153
2010.23 control 153
2011.23 control 153
2012.23 control 153
2013.23 control 153
2014.23 control 153
2015.23 control 153
2016.23 control 153
2017.23 control 153
2018.23 control 153
2019.23 control 153
2020.23 control 153
2021.23 control 153
2022.23 control 153
2000.43 treatment 153
2001.43 treatment 153
2002.43 treatment 153
2003.43 treatment 153
2004.43 treatment 153
2005.43 treatment 153
2006.43 treatment 153
2007.43 treatment 153
2008.43 treatment 153
2009.43 treatment 153
2010.43 treatment 153
2011.43 treatment 153
2012.43 treatment 153
2013.43 treatment 153
2014.43 treatment 153
2015.43 treatment 153
2016.43 treatment 153
2017.43 treatment 153
2018.43 treatment 153
2019.43 treatment 152
2020.43 treatment 153
2021.43 treatment 153
2022.43 treatment 153
2000.58 treatment 153
2001.58 treatment 153
2002.58 treatment 153
2003.58 treatment 153
2004.58 treatment 153
2005.58 treatment 153
2006.58 treatment 153
2007.58 treatment 153
2008.58 treatment 153
2009.58 treatment 153
2010.58 treatment 153
2011.58 treatment 153
2012.58 treatment 153
2013.58 treatment 153
2014.58 treatment 153
2015.58 treatment 153
2016.58 treatment 153
2017.58 treatment 153
2018.58 treatment 153
2019.58 treatment 153
2020.58 treatment 153
2021.58 treatment 153
2022.58 treatment 153
2000.65 treatment 153
2001.65 treatment 153
2002.65 treatment 153
2003.65 treatment 153
2004.65 treatment 153
2005.65 treatment 153
2006.65 treatment 153
2007.65 treatment 153
2008.65 treatment 153
2009.65 treatment 153
2010.65 treatment 153
2011.65 treatment 153
2012.65 treatment 153
2013.65 treatment 153
2014.65 treatment 153
2015.65 treatment 153
2016.65 treatment 153
2017.65 treatment 153
2018.65 treatment 153
2019.65 treatment 153
2020.65 treatment 153
2021.65 treatment 153
2022.65 treatment 153
2000.66 treatment 153
2001.66 treatment 153
2002.66 treatment 153
2003.66 treatment 153
2004.66 treatment 153
2005.66 treatment 153
2006.66 treatment 153
2007.66 treatment 153
2008.66 treatment 153
2009.66 treatment 153
2010.66 treatment 153
2011.66 treatment 153
2012.66 treatment 153
2013.66 treatment 153
2014.66 treatment 153
2015.66 treatment 153
2016.66 treatment 153
2017.66 treatment 153
2018.66 treatment 153
2019.66 treatment 153
2020.66 treatment 153
2021.66 treatment 153
2022.66 treatment 153
  • MRCs are the treated units

  • MRCs 65, 66, and 58 are the treated units (Laval, Montreal, Longueuil)

  • MRCs 23 and 43 are the control units (Quebec and Sherbrooke)

  • 2009, 2020 and 2021 are years where races didnt occurr

We formatted the data recatangularily by subsetting 35 days before and 35 days after the race, for each combination of MRC and year.

Code
collisions_weather_corr_rect <- 
  collisions_weather_corr|>
  group_by(cluster)|>
  mutate(day_diff = as.numeric(difftime(date, race_date, units = "days")))|> # Calculate difference in days
  mutate(race_window = dplyr::between(day_diff, -35, 35))|> # Check if difference is within -30 to 30 days
  ungroup()|>
  filter(race_window == TRUE)|>
  group_by(cluster)|>
  mutate(yday_corr = row_number())|>
  dplyr::select(-race_window, -day_diff)|> # Remove the temporary columns
  ungroup()  

cat(paste0("Number of rows: ", nrow(collisions_weather_corr_rect),"\n\n\n\n"))
Number of rows: 7100

Panel series

Code
df_collisions <- collisions_weather_corr|> 
  group_by(mrc_f, year, week_iso, exposure) %>%   # group by MRC, year and week
  summarise(
    nb_collisions = sum(nb_collisions),                         # count collisions
    .groups = "drop"
  )

#exposure band
exp_band <- df_collisions %>% 
    filter(exposure == 1) %>% 
    distinct(year, week_iso) %>%      # one row per (year, week) that has exposure
    mutate(
        xmin = week_iso - 0.5,            # band spans full week on x-axis
        xmax = week_iso + 0.5,
        ymin = -Inf,                      # full panel height
        ymax =  Inf
    )

ggplot(df_collisions, aes(x = week_iso, y = nb_collisions)) +
  geom_line(
    aes(group= mrc_f, colour = mrc_f), linetype = "solid"
  ) +
  geom_rect(
    data       = exp_band,
    aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
    inherit.aes = FALSE,
    fill   = "grey40",
    alpha  = 0.2
  ) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  scale_shape_manual(
    name   = "MRC",
    values = 0:(nlevels(df_collisions$mrc_f)-1)
  ) +
  facet_wrap(~ year, ncol = 6) +                 # <- one panel per year
  labs(
    x     = "ISO Week",
    y     = "Number of Collisions"
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),
    legend.position  = "right"
  )
Weekly Collisions per MRC (gray band where exposure = 1)

Weekly Collisions per MRC (gray band where exposure = 1)

If they series look strange is because in the same exposure week might be a non-exposure count.

Code
df_collisions_day <- collisions_weather_corr|> 
  group_by(mrc_f, year, iso_yday, exposure) %>%   # group by MRC, year and week
  summarise(
    nb_collisions = sum(nb_collisions),                         # count collisions
    .groups = "drop"
  )
exp_band_day <- df_collisions_day %>% 
    filter(exposure == 1) %>% 
    distinct(year, iso_yday) %>%      # one row per (year, week) that has exposure
    mutate(
        xmin = iso_yday - 0.5,            # band spans full week on x-axis
        xmax = iso_yday + 0.5,
        ymin = -Inf,                      # full panel height
        ymax =  Inf
    )

ggplot(df_collisions_day, aes(x = iso_yday, y = nb_collisions)) +
  geom_line(
    aes(group= mrc_f, colour = mrc_f), linetype = "solid"
  ) +
  geom_rect(
    data       = exp_band_day,
    aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
    inherit.aes = FALSE,
    fill   = "grey40",
    alpha  = 0.2
  ) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  scale_shape_manual(
    name   = "MRC",
    values = 0:(nlevels(df_collisions_day$mrc_f)-1)
  ) +
  facet_wrap(~ year, ncol = 6) +                 # <- one panel per year
  labs(
    x     = "ISO Day",
    y     = "Number of Collisions"
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),
    legend.position  = "right"
  )
Daily Collisions per MRC (gray band where exposure = 1)

Daily Collisions per MRC (gray band where exposure = 1)

Code
df_collisions_day <- collisions_weather_corr|> 
  group_by(mrc_f, year, iso_yday, exposure) %>%   # group by MRC, year and week
  summarise(
    nb_collisions = sum(nb_collisions),                         # count collisions
    .groups = "drop"
  )
df_collisions_day$cluster<- interaction(df_collisions_day$mrc_f,df_collisions_day$year)
Mean <- function(x) if (sum(!is.na(x)) >= 2) mean(x, na.rm = TRUE) else NA
#prior x elements (list(-seq(x)))
roll <- function(x)  zoo::rollapply(x, list(-seq(3)), Mean, fill = NA, partial = TRUE)
df_collisions_day<- 
transform(df_collisions_day, roll = ave(nb_collisions, cluster, FUN = roll))

exp_band_day <- df_collisions_day %>% 
    filter(exposure == 1) %>% 
    distinct(year, iso_yday) %>%      # one row per (year, week) that has exposure
    mutate(
        xmin = iso_yday - 0.5,            # band spans full week on x-axis
        xmax = iso_yday + 0.5,
        ymin = -Inf,                      # full panel height
        ymax =  Inf
    )

ggplot(df_collisions_day, aes(x = iso_yday, y = roll)) +
  geom_line(
    aes(group= mrc_f, colour = mrc_f), linetype = "solid"
  ) +
  geom_rect(
    data       = exp_band_day,
    aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
    inherit.aes = FALSE,
    fill   = "grey40",
    alpha  = 0.2
  ) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  scale_shape_manual(
    name   = "MRC",
    values = 0:(nlevels(df_collisions_day$mrc_f)-1)
  ) +
  facet_wrap(~ year, ncol = 6) +                 # <- one panel per year
  labs(
    x     = "ISO Day",
    y     = "Number of Collisions"
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),
    legend.position  = "right"
  )
3-day moving average of Collisions per MRC (gray band where exposure = 1)

3-day moving average of Collisions per MRC (gray band where exposure = 1)

Code
df_alcohol <- collisions_weather_corr|> 
  group_by(mrc_f, year, week_iso, exposure) %>%   # group by MRC, year and week
  summarise(
    alcohol = sum(alcohol),                         # count collisions
    .groups = "drop"
  )

#exposure band
exp_band_oh <- df_alcohol %>% 
    filter(exposure == 1) %>% 
    distinct(year, week_iso) %>%      # one row per (year, week) that has exposure
    mutate(
        xmin = week_iso - 0.5,            # band spans full week on x-axis
        xmax = week_iso + 0.5,
        ymin = -Inf,                      # full panel height
        ymax =  Inf
    )

ggplot(df_alcohol, aes(x = week_iso, y = alcohol)) +
  geom_line(
    aes(group= mrc_f, colour = mrc_f), linetype = "solid"
  ) +
  geom_rect(
    data       = exp_band_oh,
    aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
    inherit.aes = FALSE,
    fill   = "grey40",
    alpha  = 0.2
  ) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  scale_shape_manual(
    name   = "MRC",
    values = 0:(nlevels(df_alcohol$mrc_f)-1)
  ) +
  facet_wrap(~ year, ncol = 6) +                 # <- one panel per year
  labs(
    x     = "ISO Week",
    y     = "Number of Collisions Related to Alcohol (log scaled)"
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),
    legend.position  = "right"
  )+
  scale_y_continuous(
    trans  = scales::pseudo_log_trans(base = 10),  # maneja n = 0
    breaks = c(0, 1, 2, 5, 10, 20, 50, 100),
    labels = scales::comma
  ) 
Weekly Alcohol-related collisions per MRC (gray band where exposure = 1)

Weekly Alcohol-related collisions per MRC (gray band where exposure = 1)

Code
df_alcohol_day <- collisions_weather_corr|> 
  group_by(mrc_f, year, iso_yday, exposure) %>%   # group by MRC, year and week
  summarise(
    alcohol = sum(alcohol),                         # count collisions
    .groups = "drop"
  )
exp_band_day_oh <- df_alcohol_day %>% 
    filter(exposure == 1) %>% 
    distinct(year, iso_yday) %>%      # one row per (year, week) that has exposure
    mutate(
        xmin = iso_yday - 0.5,            # band spans full week on x-axis
        xmax = iso_yday + 0.5,
        ymin = -Inf,                      # full panel height
        ymax =  Inf
    )

ggplot(df_alcohol_day, aes(x = iso_yday, y = alcohol)) +
  geom_line(
    aes(group= mrc_f, colour = mrc_f), linetype = "solid"
  ) +
  geom_rect(
    data       = exp_band_day,
    aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
    inherit.aes = FALSE,
    fill   = "grey40",
    alpha  = 0.2
  ) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  scale_shape_manual(
    name   = "MRC",
    values = 0:(nlevels(df_alcohol_day$mrc_f)-1)
  ) +
  facet_wrap(~ year, ncol = 6) +                 # <- one panel per year
  labs(
    x     = "ISO Day",
    y     = "Number of Collisions Related to Alcohol (log scaled)"
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),
    legend.position  = "right"
  )+
  scale_y_continuous(
    trans  = scales::pseudo_log_trans(base = 10),  # maneja n = 0
    breaks = c(0, 1, 2, 5, 10, 20, 50, 100),
    labels = scales::comma
  ) 
Daily Alcohol-related collisions per MRC (gray band where exposure = 1)

Daily Alcohol-related collisions per MRC (gray band where exposure = 1)

Code
df_alcohol_day <- collisions_weather_corr|> 
  group_by(mrc_f, year, iso_yday, exposure) %>%   # group by MRC, year and week
  summarise(
    alcohol = sum(alcohol),                         # count collisions
    .groups = "drop"
  )

df_alcohol_day$cluster<- interaction(df_alcohol_day$mrc_f,df_alcohol_day$year)
Mean <- function(x) if (sum(!is.na(x)) >= 2) mean(x, na.rm = TRUE) else NA
#prior x elements (list(-seq(x)))
roll <- function(x)  zoo::rollapply(x, list(-seq(3)), Mean, fill = NA, partial = TRUE)
df_alcohol_day<- 
transform(df_alcohol_day, roll = ave(alcohol, cluster, FUN = roll))

exp_band_day_oh <- df_alcohol_day %>% 
    filter(exposure == 1) %>% 
    distinct(year, iso_yday) %>%      # one row per (year, week) that has exposure
    mutate(
        xmin = iso_yday - 0.5,            # band spans full week on x-axis
        xmax = iso_yday + 0.5,
        ymin = -Inf,                      # full panel height
        ymax =  Inf
    )

ggplot(df_alcohol_day, aes(x = iso_yday, y = roll)) +
  geom_line(
    aes(group= mrc_f, colour = mrc_f), linetype = "solid"
  ) +
  geom_rect(
    data       = exp_band_day,
    aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
    inherit.aes = FALSE,
    fill   = "grey40",
    alpha  = 0.2
  ) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  scale_shape_manual(
    name   = "MRC",
    values = 0:(nlevels(df_alcohol_day$mrc_f)-1)
  ) +
  facet_wrap(~ year, ncol = 6) +                 # <- one panel per year
  labs(
    x     = "ISO Day",
    y     = "Number of Collisions related to Alcohol (log scaled)"
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),
    legend.position  = "right"
  )+
  scale_y_continuous(
    trans  = scales::pseudo_log_trans(base = 10),  # maneja n = 0
    breaks = c(0, 1, 2, 5, 10, 20, 50, 100),
    labels = scales::comma
  ) 
3-day moving average of Alcohol-related collisions per MRC (gray band where exposure = 1)

3-day moving average of Alcohol-related collisions per MRC (gray band where exposure = 1)

Code
df_speed <- collisions_weather_corr |> 
  group_by(mrc_f, year, week_iso, exposure) %>%
  summarise(high_speed_tickets = sum(velocidad), .groups = "drop")

exp_band_speed <- df_speed %>%
  filter(exposure == 1) %>%
  distinct(year, week_iso) %>%
  mutate(xmin = week_iso - 0.5, xmax = week_iso + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_speed, aes(x = week_iso, y = high_speed_tickets)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_speed, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Week", y = "Number of High‑speed Collisions (log scaled)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Weekly High‑speed collisions per MRC (grey band where exposure = 1)

Weekly High‑speed collisions per MRC (grey band where exposure = 1)

Code
df_speed_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(high_speed_tickets = sum(velocidad), .groups = "drop")

exp_band_speed_day <- df_speed_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_speed_day, aes(x = iso_yday, y = high_speed_tickets)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_speed_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Number of High‑speed Collisions (log scaled)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Daily High‑speed Collisions per MRC (grey band where exposure = 1)

Daily High‑speed Collisions per MRC (grey band where exposure = 1)

Code
df_speed_per_vh <- collisions_weather_corr |> 
  group_by(mrc_f, year, week_iso, exposure) %>%
  reframe(high_speed_tickets_per_vh = (sum(velocidad, na.rm=T)/sum(vehicles_use_type, na.rm=T))*1e6, .groups = "drop")

exp_band_speed_per_vh <- df_speed_per_vh %>%
  filter(exposure == 1) %>%
  distinct(year, week_iso) %>%
  mutate(xmin = week_iso - 0.5, xmax = week_iso + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_speed_per_vh, aes(x = week_iso, y = high_speed_tickets_per_vh)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_speed_per_vh, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Week", y = "Number of High‑speed Collisions (log scaled)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right")  +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Weekly High‑speed collisions per 1 MM vehicles by MRC (grey band where exposure = 1)

Weekly High‑speed collisions per 1 MM vehicles by MRC (grey band where exposure = 1)

Code
df_speed_day_per_vh <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  reframe(high_speed_tickets_per_vh = (sum(velocidad, na.rm=T)/sum(vehicles_use_type, na.rm=T))*1e6, .groups = "drop")

exp_band_speed_day_per_vh <- df_speed_day_per_vh %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_speed_day_per_vh, aes(x = iso_yday, y = high_speed_tickets_per_vh)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_speed_day_per_vh, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Number of High‑speed Tickets per 100 vehicles (log scaled)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Daily High‑speed collisions per 1MM vehicles by MRC (grey band where exposure = 1)

Daily High‑speed collisions per 1MM vehicles by MRC (grey band where exposure = 1)

Code
df_fatal <- collisions_weather_corr |> 
  group_by(mrc_f, year, week_iso, exposure) %>%
  summarise(fatalities = sum(nb_mort_c), .groups = "drop")

exp_band_fatal <- df_fatal %>%
  filter(exposure == 1) %>%
  distinct(year, week_iso) %>%
  mutate(xmin = week_iso - 0.5, xmax = week_iso + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_fatal, aes(x = week_iso, y = fatalities)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_fatal, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Week", y = "Number of Fatalities (log scaled)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Weekly Fatalities per MRC (grey band where exposure = 1)

Weekly Fatalities per MRC (grey band where exposure = 1)

Code
df_fatal_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(fatalities = sum(nb_mort_c), .groups = "drop")

exp_band_fatal_day <- df_fatal_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_fatal_day, aes(x = iso_yday, y = fatalities)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_fatal_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Number of Fatalities (log scaled)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Daily Fatalities per MRC (grey band where exposure = 1)

Daily Fatalities per MRC (grey band where exposure = 1)

Code
df_fatal_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(fatalities = sum(nb_mort_c), .groups = "drop")


df_fatal_day$cluster<- interaction(df_fatal_day$mrc_f,df_fatal_day$year)
Mean <- function(x) if (sum(!is.na(x)) >= 2) mean(x, na.rm = TRUE) else NA
#prior x elements (list(-seq(x)))
roll <- function(x)  zoo::rollapply(x, list(-seq(3)), Mean, fill = NA, partial = TRUE)
df_speed_day<- 
transform(df_fatal_day, roll = ave(fatalities, cluster, FUN = roll))

exp_band_fatal_day <- df_fatal_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_fatal_day, aes(x = iso_yday, y = fatalities)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_fatal_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Number of Fatalities (log scaled)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
3-day moving average Fatalities per MRC (grey band where exposure = 1)

3-day moving average Fatalities per MRC (grey band where exposure = 1)

Code
df_serious <- collisions_weather_corr |> 
  group_by(mrc_f, year, week_iso, exposure) %>%
  summarise(seriously_injured = sum(nb_blese_grave_c), .groups = "drop")

exp_band_serious <- df_serious %>%
  filter(exposure == 1) %>%
  distinct(year, week_iso) %>%
  mutate(xmin = week_iso - 0.5, xmax = week_iso + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_serious, aes(x = week_iso, y = seriously_injured)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_serious, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Week", y = "Seriously Injured (log scale)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Weekly Seriously Injured per MRC (grey band where exposure = 1)

Weekly Seriously Injured per MRC (grey band where exposure = 1)

Code
df_serious_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(seriously_injured = sum(nb_blese_grave_c), .groups = "drop")

exp_band_serious_day <- df_serious_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_serious_day, aes(x = iso_yday, y = seriously_injured)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_serious_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Seriously Injured (log scale)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Daily Seriously Injured per MRC (grey band where exposure = 1)

Daily Seriously Injured per MRC (grey band where exposure = 1)

Code
df_serious_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(seriously_injured = sum(nb_blese_grave_c), .groups = "drop")


df_serious_day$cluster<- interaction(df_serious_day$mrc_f,df_serious_day$year)
Mean <- function(x) if (sum(!is.na(x)) >= 2) mean(x, na.rm = TRUE) else NA
#prior x elements (list(-seq(x)))
roll <- function(x)  zoo::rollapply(x, list(-seq(3)), Mean, fill = NA, partial = TRUE)
df_serious_day<- 
transform(df_serious_day, roll = ave(seriously_injured, cluster, FUN = roll))

exp_band_serious_day <- df_serious_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_serious_day, aes(x = iso_yday, y = seriously_injured)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_serious_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Seriously Injured (log scale)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
3-day moving average Seriously Injured per MRC (grey band where exposure = 1)

3-day moving average Seriously Injured per MRC (grey band where exposure = 1)

Code
df_minor <- collisions_weather_corr |> 
  group_by(mrc_f, year, week_iso, exposure) %>%
  summarise(minor_injuries = sum(nb_blese_leger_c), .groups = "drop")

exp_band_minor <- df_minor %>%
  filter(exposure == 1) %>%
  distinct(year, week_iso) %>%
  mutate(xmin = week_iso - 0.5, xmax = week_iso + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_minor, aes(x = week_iso, y = minor_injuries)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_minor, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Week", y = "Minor Injuries (log scale)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Weekly Minor Injuries per MRC (grey band where exposure = 1)

Weekly Minor Injuries per MRC (grey band where exposure = 1)

Code
df_minor_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(minor_injuries = sum(nb_blese_leger_c), .groups = "drop")

exp_band_minor_day <- df_minor_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_minor_day, aes(x = iso_yday, y = minor_injuries)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_minor_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Minor Injuries (log scale)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
Daily Minor Injuries per MRC (grey band where exposure = 1)

Daily Minor Injuries per MRC (grey band where exposure = 1)

Code
df_minor_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(minor_injuries = sum(nb_blese_leger_c), .groups = "drop")


df_minor_day$cluster<- interaction(df_minor_day$mrc_f,df_minor_day$year)
Mean <- function(x) if (sum(!is.na(x)) >= 2) mean(x, na.rm = TRUE) else NA
#prior x elements (list(-seq(x)))
roll <- function(x)  zoo::rollapply(x, list(-seq(3)), Mean, fill = NA, partial = TRUE)
df_speed_day<- 
transform(df_minor_day, roll = ave(minor_injuries, cluster, FUN = roll))

exp_band_minor_day <- df_minor_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_minor_day, aes(x = iso_yday, y = minor_injuries)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_minor_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Minor Injuries (log scale)") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") +
  scale_y_continuous(trans = scales::pseudo_log_trans(base = 10),
                     breaks = c(0,1,2,5,10,20,50,100), labels = scales::comma)
3-day moving average Minor Injuries per MRC (grey band where exposure = 1)

3-day moving average Minor Injuries per MRC (grey band where exposure = 1)

Code
df_vehicules <- collisions_weather_corr |> 
  group_by(mrc_f, year, week_iso, exposure) %>%
  summarise(nb_vehicules = sum(nb_vehicules), .groups = "drop")

exp_band_veh <- df_vehicules %>%
  filter(exposure == 1) %>%
  distinct(year, week_iso) %>%
  mutate(xmin = week_iso - 0.5, xmax = week_iso + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_vehicules, aes(x = week_iso, y = nb_vehicules)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_veh, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Week", y = "Vehicle Counts") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") 
Weekly Vehicle Counts per MRC (grey band where exposure = 1)

Weekly Vehicle Counts per MRC (grey band where exposure = 1)

Code
df_vehicules_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(nb_vehicules = sum(nb_vehicules), .groups = "drop")

exp_band_veh_day <- df_vehicules_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_vehicules_day, aes(x = iso_yday, y = nb_vehicules)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_veh_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Vehicle Counts") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") 
Daily Vehicle Counts per MRC (grey band where exposure = 1)

Daily Vehicle Counts per MRC (grey band where exposure = 1)

Code
df_vehicules_day <- collisions_weather_corr |> 
  group_by(mrc_f, year, iso_yday, exposure) %>%
  summarise(nb_vehicules = sum(nb_vehicules), .groups = "drop")


df_vehicules_day$cluster<- interaction(df_vehicules_day$mrc_f,df_vehicules_day$year)
Mean <- function(x) if (sum(!is.na(x)) >= 2) mean(x, na.rm = TRUE) else NA
#prior x elements (list(-seq(x)))
roll <- function(x)  zoo::rollapply(x, list(-seq(3)), Mean, fill = NA, partial = TRUE)
df_speed_day<- 
transform(df_vehicules_day, roll = ave(nb_vehicules, cluster, FUN = roll))

exp_band_veh_day <- df_vehicules_day %>%
  filter(exposure == 1) %>%
  distinct(year, iso_yday) %>%
  mutate(xmin = iso_yday - 0.5, xmax = iso_yday + 0.5, ymin = -Inf, ymax = Inf)

ggplot(df_vehicules_day, aes(x = iso_yday, y = nb_vehicules)) +
  geom_line(aes(group = mrc_f, colour = mrc_f)) +
  geom_rect(data = exp_band_veh_day, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
            inherit.aes = FALSE, fill = "grey40", alpha = 0.2) +
  scale_colour_brewer(palette = "Dark2", name = "MRC") +
  facet_wrap(~ year, ncol = 6) +
  labs(x = "ISO Day", y = "Vehicle Counts") +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(), legend.position = "right") 
3-day moving average Vehicle Counts per MRC (grey band where exposure = 1)

3-day moving average Vehicle Counts per MRC (grey band where exposure = 1)

Test panel structure

Code
#https://cran.r-project.org/web/packages/plm/vignettes/A_plmPackage.html

E <- plm::pdata.frame(collisions_weather_corr_rect|>
                        mutate(sum_veh=vehicles_use_type, Y= (velocidad/vehicles_use_type)*1e6), 
                      index=c("cluster","yday_corr"), drop.index=TRUE, row.names=TRUE)

cat("Fixed effects (two–way: individual + time)\n")
fixef_model <- plm(Y ~ D+ min_temp_mean_lin+ max_temp_mean_lin+ total_precip_median_lin+ lag_2_prec_median_lin_imp,#+ offset(vehicles_use_type), #not needed
           data = E, model = "within", index = "townid")
summary(fixef_model)

cat("Robust coefficients\n")
lmtest::coeftest(fixef_model,
         vcov = function(x) vcovSCC(x, type = "HC1", maxlag = 2))

cat("Random effects (two–way)\n")
re_tw <- plm(
  Y ~ D + min_temp_mean_lin + max_temp_mean_lin +
        total_precip_median_lin + lag_2_prec_median_lin_imp,#+ offset(vehicles_use_type), #not needed
  data   = E,
  model  = "random",
  effect = "twoways"
)
summary(re_tw)

 phtest(fixef_model, re_tw) 
#   Hausman Test
# 
# data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +  ...
# chisq = 22.392, df = 5, p-value = 0.000441
# alternative hypothesis: one model is inconsistent

cat("Wooldridge test (first-order, idiosyncratic)\n")
pbgtest(fixef_model)

# Breusch-Godfrey/Wooldridge test for serial correlation in panel models
# 
# data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +  ...
# chisq = 202.71, df = 71, p-value = 1.321e-14
# alternative hypothesis: serial correlation in idiosyncratic errors

cat("Breusch–Godfrey (panel)    \n")
pwartest(fixef_model)
#   Wooldridge's test for serial correlation in FE panels
# 
# data:  fixef_model
# F = 0.3438, df1 = 1, df2 = 6998, p-value = 0.5577
# alternative hypothesis: serial correlation

cat("BP / White (panel) \n")
lmtest::bptest(fixef_model)
#   studentized Breusch-Pagan test
# 
# data:  fixef_model
# BP = 27.318, df = 5, p-value = 0.00004946

plmtest(fixef_model, type = "bp")
#   Lagrange Multiplier Test - (Breusch-Pagan)
# 
# data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +  ...
# chisq = 8552.8, df = 1, p-value < 2.2e-16
# alternative hypothesis: significant effects

cat("cross-section dependence\n")
pcdtest(fixef_model, test = "cd") 
#   Pesaran CD test for cross-sectional dependence in panels
# 
# data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +     lag_2_prec_median_lin_imp
#z = 3.2052, p-value = 0.00135
# alternative hypothesis: cross-sectional dependence
Fixed effects (two–way: individual + time)
Oneway (individual) effect Within Model

Call:
plm(formula = Y ~ D + min_temp_mean_lin + max_temp_mean_lin + 
    total_precip_median_lin + lag_2_prec_median_lin_imp, data = E, 
    model = "within", index = "townid")

Balanced Panel: n = 100, T = 71, N = 7100

Residuals:
    Min.  1st Qu.   Median  3rd Qu.     Max. 
-3.94882 -0.94737 -0.38854  0.67581 17.96750 

Coefficients:
                             Estimate  Std. Error t-value    Pr(>|t|)    
D                          0.26205923  0.08514964  3.0776    0.002095 ** 
min_temp_mean_lin          0.00731450  0.00668995  1.0934    0.274275    
max_temp_mean_lin          0.01188647  0.00599374  1.9831    0.047390 *  
total_precip_median_lin    0.01634397  0.00340616  4.7984 0.000001633 ***
lag_2_prec_median_lin_imp -0.00021014  0.00323096 -0.0650    0.948145    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Total Sum of Squares:    22380
Residual Sum of Squares: 22210
R-Squared:      0.0075944
Adj. R-Squared: -0.0071605
F-statistic: 10.7058 on 5 and 6995 DF, p-value: 2.8684e-10
Robust coefficients

t test of coefficients:

                             Estimate  Std. Error t value  Pr(>|t|)    
D                          0.26205923  0.07455394  3.5150 0.0004425 ***
min_temp_mean_lin          0.00731450  0.00703739  1.0394 0.2986653    
max_temp_mean_lin          0.01188647  0.00553930  2.1458 0.0319198 *  
total_precip_median_lin    0.01634397  0.00403703  4.0485 0.0000521 ***
lag_2_prec_median_lin_imp -0.00021014  0.00283921 -0.0740 0.9410026    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Random effects (two–way)
Twoways effects Random Effect Model 
   (Swamy-Arora's transformation)

Call:
plm(formula = Y ~ D + min_temp_mean_lin + max_temp_mean_lin + 
    total_precip_median_lin + lag_2_prec_median_lin_imp, data = E, 
    effect = "twoways", model = "random")

Balanced Panel: n = 100, T = 71, N = 7100

Effects:
                  var std.dev share
idiosyncratic 3.15832 1.77717 0.841
individual    0.57982 0.76146 0.154
time          0.01663 0.12894 0.004
theta: 0.7331 (id) 0.1906 (time) 0.1857 (total)

Residuals:
    Min.  1st Qu.   Median  3rd Qu.     Max. 
-3.29104 -1.02471 -0.56762  0.69640 18.26990 

Coefficients:
                             Estimate  Std. Error z-value  Pr(>|z|)    
(Intercept)                0.90530936  0.13365594  6.7734 1.258e-11 ***
D                          0.25917852  0.09986462  2.5953  0.009451 ** 
min_temp_mean_lin          0.00834633  0.00690027  1.2096  0.226445    
max_temp_mean_lin          0.00931032  0.00603389  1.5430  0.122829    
total_precip_median_lin    0.01573930  0.00342091  4.6009 4.206e-06 ***
lag_2_prec_median_lin_imp -0.00066677  0.00325165 -0.2051  0.837528    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Total Sum of Squares:    22640
Residual Sum of Squares: 22501
R-Squared:      0.0061403
Adj. R-Squared: 0.0054398
Chisq: 43.8282 on 5 DF, p-value: 2.5099e-08

    Hausman Test

data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +  ...
chisq = 22.392, df = 5, p-value = 0.000441
alternative hypothesis: one model is inconsistent

Wooldridge test (first-order, idiosyncratic)

    Breusch-Godfrey/Wooldridge test for serial correlation in panel models

data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +  ...
chisq = 202.71, df = 71, p-value = 1.321e-14
alternative hypothesis: serial correlation in idiosyncratic errors

Breusch–Godfrey (panel) 

    Wooldridge's test for serial correlation in FE panels

data:  fixef_model
F = 0.3438, df1 = 1, df2 = 6998, p-value = 0.5577
alternative hypothesis: serial correlation

BP / White (panel)  

    studentized Breusch-Pagan test

data:  fixef_model
BP = 27.318, df = 5, p-value = 0.00004946


    Lagrange Multiplier Test - (Breusch-Pagan)

data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +  ...
chisq = 8552.8, df = 1, p-value < 2.2e-16
alternative hypothesis: significant effects

cross-section dependence

    Pesaran CD test for cross-sectional dependence in panels

data:  Y ~ D + min_temp_mean_lin + max_temp_mean_lin + total_precip_median_lin +     lag_2_prec_median_lin_imp
z = 3.2052, p-value = 0.00135
alternative hypothesis: cross-sectional dependence
  • Hausman test indicates that Fixed effects is consistent but FE not.

  • Breusch-Pagan indicates that panel structure is needed, given unobserved heterogeneity, FE shoul be used

  • Studentized Breusch-Pagan test indicates that corss-secitonal heteroskedasticity is present

  • Cross section dependence also noted, so there may be correlated units.

  • There is a clear first-order autorregressive structure (Wooldridge’s test), and a more general serial correlation (Breusch-Godfrey/Wooldridge test).

Code
acf(residuals(fixef_model), lag.max=50)
pacf(residuals(fixef_model), lag.max = 50)

Box.test(residuals(fixef_model), lag = 10, type = "Ljung-Box")
Box.test(residuals(fixef_model), lag = 20, type = "Ljung-Box")
Box.test(residuals(fixef_model), lag = 30, type = "Ljung-Box")

    Box-Ljung test

data:  residuals(fixef_model)
X-squared = 29.327, df = 10, p-value = 0.001103


    Box-Ljung test

data:  residuals(fixef_model)
X-squared = 87.783, df = 20, p-value = 1.805e-10


    Box-Ljung test

data:  residuals(fixef_model)
X-squared = 101.36, df = 30, p-value = 1.131e-09
ACF plots

ACF plots

ACF plots

ACF plots

Several Box–Ljung tests up to lag 10, 20 and 30 rejected white-noise residuals (p < 0.001), indicating serial correlation beyond autorregressive first-order structure. Partial autocorrelation plots show spikes at 3, 4, 10, 11, 14, 18, 19, 20, 25, 38, and 43, this is why there is a direct autocorrelation, despite there is no single lagged structure that dominates. It is recommended that we adjust on the lagged outcome at these spikes.


Session info

Code
cat(paste0("R library: ", Sys.getenv("R_LIBS_USER")))
cat(paste0("Date: ",withr::with_locale(new = c('LC_TIME' = 'C'), code =Sys.time())))
cat(paste0("Editor context: ", getwd()))
cat("quarto version: "); system("quarto --version") 

quarto::quarto_version()

save.image("_data/step1.RData")
saveRDS(collisions_weather_corr, file = "_data/collisions_weather.rds", ascii = FALSE, version = NULL, compress = TRUE, refhook = NULL)
R library: H:/Mi unidad/PERSONAL ANDRES/UCH_salud_publica/pasantia/f1/f1/renv/library/windows/R-4.4/x86_64-w64-mingw32Date: 2025-07-07 17:15:40.278964Editor context: H:/Mi unidad/PERSONAL ANDRES/UCH_salud_publica/pasantia/f1/f1quarto version: [1] 0
[1] '1.6.39'
Code
sesion_info <- devtools::session_info()
Warning in system2("quarto", "-V", stdout = TRUE, env = paste0("TMPDIR=", : el
comando ejecutado '"quarto"
TMPDIR=C:/Users/andre/AppData/Local/Temp/Rtmp0ydj1m/file40584ccb7d06 -V' tiene
el estatus 1
Code
dplyr::select(
  tibble::as_tibble(sesion_info$packages),
  c(package, loadedversion, source)
) |> 
 knitr::kable(caption = "R packages", format = "html",
      col.names = c("Row number", "Package", "Version"),
    row.names = FALSE,
      align = c("c", "l", "r")) |> 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover"),font_size = 12)|> 
  kableExtra::scroll_box(width = "100%", height = "375px")  
R packages
Row number Package Version
abind 1.4-8 RSPM
assertthat 0.2.1 RSPM
backports 1.5.0 RSPM
bayesplot 1.12.0 RSPM
bdsmatrix 1.3-7 RSPM
bit 4.6.0 CRAN (R 4.4.3)
bit64 4.6.0-1 CRAN (R 4.4.3)
Boom 0.9.15 RSPM
BoomSpikeSlab 1.2.6 RSPM
boot 1.3-30 CRAN (R 4.4.1)
bpmn 0.1.0 Github (bergant/bpmn@628d3efaa27544c221b2fd7f1895301a63b70c49)
bridgesampling 1.1-2 RSPM
brms 2.22.0 RSPM
Brobdingnag 1.2-9 RSPM
broom 1.0.8 RSPM
bsts 0.9.10 RSPM
cachem 1.1.0 CRAN (R 4.4.3)
car 3.1-3 RSPM
carData 3.0-5 RSPM
CausalImpact 1.3.0 RSPM
CBPS 0.23 RSPM
checkmate 2.3.2 RSPM
cli 3.6.5 RSPM
coda 0.19-4.1 RSPM
codetools 0.2-20 CRAN (R 4.4.1)
collapse 2.1.2 RSPM
colorspace 2.1-1 RSPM
conquer 1.3.3 RSPM
crayon 1.5.3 CRAN (R 4.4.3)
cubature 2.1.4 RSPM
curl 6.2.3 CRAN (R 4.4.1)
CVXR 1.0-15 RSPM
dagitty 0.3-4 RSPM
data.table 1.17.4 RSPM
devtools 2.4.5 RSPM
DHARMa 0.4.7 RSPM
digest 0.6.37 RSPM
distributional 0.5.0 RSPM
doParallel 1.0.17 RSPM
doRNG 1.8.6.2 RSPM
doSNOW 1.0.20 RSPM
dplyr 1.1.4 RSPM
dreamerr 1.5.0 RSPM
ECOSolveR 0.5.5 RSPM
ellipsis 0.3.2 RSPM
emmeans 1.11.1 RSPM
estimability 1.5.1 RSPM
evaluate 1.0.3 RSPM
farver 2.1.2 RSPM
fastDummies 1.7.5 RSPM
fastmap 1.2.0 CRAN (R 4.4.3)
fect 1.0.0 RSPM
fixest 0.12.1 RSPM
forcats 1.0.0 RSPM
foreach 1.5.2 RSPM
forecast 8.24.0 RSPM
Formula 1.2-5 RSPM
fracdiff 1.5-3 RSPM
fs 1.6.6 RSPM
future 1.49.0 RSPM
future.apply 1.11.3 RSPM
geeM 0.10.1 RSPM
geepack 1.3.12 RSPM
generics 0.1.4 RSPM
geosphere 1.5-20 RSPM
GGally 2.2.1 RSPM
ggdag 0.2.13 RSPM
ggplot2 3.5.2 RSPM
ggstats 0.9.0 RSPM
glmmTMB 1.1.11 RSPM
glmnet 4.1-9 RSPM
glmx 0.2-1 RSPM
globals 0.18.0 RSPM
glue 1.8.0 RSPM
gmp 0.7-5 RSPM
gnm 1.1-5 RSPM
gridExtra 2.3 RSPM
gtable 0.3.6 RSPM
gtools 3.9.5 RSPM
haven 2.5.4 RSPM
hms 1.1.3 CRAN (R 4.4.3)
htmltools 0.5.8.1 RSPM
htmlwidgets 1.6.4 RSPM
httpuv 1.6.16 RSPM
httr 1.4.7 CRAN (R 4.4.3)
httr2 1.1.2 RSPM
igraph 2.1.4 RSPM
iterators 1.0.14 RSPM
jsonlite 2.0.0 CRAN (R 4.4.3)
kableExtra 1.4.0 RSPM
kernlab 0.9-33 RSPM
knitr 1.50 RSPM
labeling 0.4.3 RSPM
later 1.4.2 RSPM
lattice 0.22-6 CRAN (R 4.4.1)
lfe 3.1.1 RSPM
lifecycle 1.0.4 RSPM
listenv 0.9.1 RSPM
lme4 1.1-37 RSPM
lmtest 0.9-40 RSPM
loo 2.8.0 RSPM
lubridate 1.9.4 RSPM
magrittr 2.0.3 RSPM
MASS 7.3-60.2 CRAN (R 4.4.1)
MatchIt 4.7.2 RSPM
Matrix 1.7-0 CRAN (R 4.4.1)
MatrixModels 0.5-4 RSPM
matrixStats 1.5.0 RSPM
maxLik 1.5-2.1 RSPM
memoise 2.0.1 CRAN (R 4.4.3)
mgcv 1.9-1 CRAN (R 4.4.1)
mime 0.13 CRAN (R 4.4.3)
miniUI 0.1.2 RSPM
minqa 1.2.8 RSPM
miscTools 0.6-28 RSPM
mvtnorm 1.3-3 RSPM
nixtlar 0.6.2 RSPM
nlme 3.1-164 CRAN (R 4.4.1)
nloptr 2.2.1 RSPM
nnet 7.3-19 CRAN (R 4.4.1)
np 0.60-18 RSPM
numDeriv 2016.8-1.1 RSPM
openxlsx 4.2.8 RSPM
optimx 2025-4.9 RSPM
PanelMatch 3.1.1 RSPM
parallelly 1.44.0 RSPM
pillar 1.10.2 RSPM
pkgbuild 1.4.8 RSPM
pkgconfig 2.0.3 RSPM
pkgload 1.4.0 RSPM
plm 2.6-6 RSPM
plyr 1.8.9 RSPM
posterior 1.6.1 RSPM
pracma 2.4.4 CRAN (R 4.4.1)
processx 3.8.6 RSPM
profvis 0.4.0 RSPM
promises 1.3.2 RSPM
ps 1.9.1 RSPM
purrr 1.0.4 RSPM
Qtools 1.5.9 RSPM
quadprog 1.5-8 RSPM
quantdr 1.2.2 RSPM
quantmod 0.4.28 RSPM
quantreg 6.1 RSPM
quarto 1.4.4 RSPM
qvcalc 1.0.4 RSPM
R.methodsS3 1.8.2 RSPM
R.oo 1.27.1 RSPM
R.utils 2.13.0 RSPM
R6 2.6.1 RSPM
rappdirs 0.3.3 CRAN (R 4.4.3)
rbibutils 2.3 RSPM
RColorBrewer 1.1-3 RSPM
Rcpp 1.0.14 RSPM
RcppParallel 5.1.10 RSPM
Rdpack 2.6.4 RSPM
readr 2.1.5 CRAN (R 4.4.3)
reformulas 0.4.1 RSPM
relimp 1.0-5 RSPM
remotes 2.5.0 RSPM
renv 1.1.2 CRAN (R 4.4.1)
reshape2 1.4.4 RSPM
rgenoud 5.9-0.11 RSPM
rio 1.2.3 RSPM
rlang 1.1.6 RSPM
rmarkdown 2.29 RSPM
Rmpfr 1.1-0 RSPM
rngtools 1.5.2 RSPM
rstantools 2.4.0 RSPM
rstudioapi 0.17.1 RSPM
sandwich 3.1-1 RSPM
scales 1.4.0 RSPM
scpi 3.0.0 RSPM
sessioninfo 1.2.3 RSPM
shape 1.4.6.1 RSPM
shiny 1.10.0 RSPM
snow 0.4-4 RSPM
sp 2.2-0 RSPM
SparseM 1.84-2 RSPM
stringi 1.8.7 RSPM
stringmagic 1.2.0 RSPM
stringr 1.5.1 RSPM
survival 3.6-4 CRAN (R 4.4.1)
svglite 2.2.1 RSPM
Synth 1.1-8 RSPM
systemfonts 1.2.3 RSPM
tensorA 0.36.2.1 RSPM
textshaping 1.0.1 RSPM
tibble 3.2.1 RSPM
tidygraph 1.3.1 RSPM
tidyr 1.3.1 RSPM
tidyselect 1.2.1 RSPM
tidyverse 2.0.0 RSPM
timechange 0.3.0 RSPM
timeDate 4041.110 RSPM
TMB 1.9.17 RSPM
tseries 0.10-58 RSPM
TTR 0.24.4 RSPM
tzdb 0.5.0 CRAN (R 4.4.3)
urca 1.3-4 RSPM
urlchecker 1.0.1 RSPM
usethis 3.1.0 RSPM
utf8 1.2.5 RSPM
V8 6.0.3 RSPM
vctrs 0.6.5 RSPM
viridisLite 0.4.2 RSPM
vroom 1.6.5 CRAN (R 4.4.3)
weathercan 0.7.3.9000 https://ropensci.r-universe.dev (R 4.4.3)
webshot 0.5.5 RSPM
withr 3.0.2 RSPM
xfun 0.52 RSPM
xml2 1.3.8 CRAN (R 4.4.3)
xtable 1.8-4 RSPM
xts 0.14.1 RSPM
yaml 2.3.10 RSPM
zip 2.3.3 RSPM
zoo 1.8-14 RSPM
Code
reticulate::py_list_packages()%>% 
 knitr::kable(caption = "Python packages", format = "html",
      col.names = c("Package", "Version", "Requirement"),
    row.names = FALSE,
      align = c("c", "l", "r", "r"))%>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover"),font_size = 12)|>
  kableExtra::scroll_box(width = "100%", height = "375px")  
Python packages
Package Version Requirement
absl-py 2.1.0 absl-py==2.1.0
asttokens 2.4.1 asttokens==2.4.1
astunparse 1.6.3 astunparse==1.6.3
audioconverter 2.0.3 audioconverter==2.0.3
autograd 1.6.2 autograd==1.6.2
autograd-gamma 0.5.0 autograd-gamma==0.5.0
beautifulsoup4 4.12.3 beautifulsoup4==4.12.3
Brotli 1.1.0 Brotli==1.1.0
certifi 2023.11.17 certifi==2023.11.17
cffi 1.16.0 cffi==1.16.0
charset-normalizer 3.3.2 charset-normalizer==3.3.2
clarabel 0.9.0 clarabel==0.9.0
click 8.1.7 click==8.1.7
cloudpickle 3.0.0 cloudpickle==3.0.0
colorama 0.4.6 colorama==0.4.6
comm 0.2.1 comm==0.2.1
contourpy 1.2.0 contourpy==1.2.0
cvxopt 1.3.2 cvxopt==1.3.2
cvxpy 1.5.2 cvxpy==1.5.2
cycler 0.12.1 cycler==0.12.1
debugpy 1.8.0 debugpy==1.8.0
decorator 4.4.2 decorator==4.4.2
delete-chrome-history-py 0.1.8 delete-chrome-history-py==0.1.8
easyocr 1.7.1 easyocr==1.7.1
ecos 2.0.13 ecos==2.0.13
editdistance 0.8.1 editdistance==0.8.1
efficientnet 1.0.0 efficientnet==1.0.0
essential-generators 1.0 essential-generators==1.0
et-xmlfile 1.1.0 et-xmlfile==1.1.0
executing 2.0.1 executing==2.0.1
fancyimpute 0.7.0 fancyimpute==0.7.0
ffmpeg 1.4 ffmpeg==1.4
ffmpeg-python 0.2.0 ffmpeg-python==0.2.0
filedir 0.0.3 filedir==0.0.3
filelock 3.13.1 filelock==3.13.1
flatbuffers 24.3.25 flatbuffers==24.3.25
fonttools 4.47.2 fonttools==4.47.2
formulaic 1.0.1 formulaic==1.0.1
fsspec 2023.12.2 fsspec==2023.12.2
future 0.18.3 future==0.18.3
gast 0.6.0 gast==0.6.0
git-filter-repo 2.45.0 git-filter-repo==2.45.0
google-pasta 0.2.0 google-pasta==0.2.0
graphviz 0.20.3 graphviz==0.20.3
grpcio 1.65.4 grpcio==1.65.4
gTTS 2.5.1 gTTS==2.5.1
h5py 3.11.0 h5py==3.11.0
idna 3.6 idna==3.6
imageio 2.34.2 imageio==2.34.2
imageio-ffmpeg 0.5.1 imageio-ffmpeg==0.5.1
imgaug 0.4.0 imgaug==0.4.0
iniconfig 2.0.0 iniconfig==2.0.0
interface-meta 1.3.0 interface-meta==1.3.0
ipykernel 6.29.5 ipykernel==6.29.5
ipython 8.20.0 ipython==8.20.0
jedi 0.19.1 jedi==0.19.1
Jinja2 3.1.3 Jinja2==3.1.3
joblib 1.4.0 joblib==1.4.0
jupyter_client 8.6.0 jupyter_client==8.6.0
jupyter_core 5.7.1 jupyter_core==5.7.1
keras 3.4.1 keras==3.4.1
Keras-Applications 1.0.8 Keras-Applications==1.0.8
keras-ocr 0.9.3 keras-ocr==0.9.3
kiwisolver 1.4.5 kiwisolver==1.4.5
knnimpute 0.1.0 knnimpute==0.1.0
lazy_loader 0.4 lazy_loader==0.4
libclang 18.1.1 libclang==18.1.1
lifelines 0.28.0 lifelines==0.28.0
llvmlite 0.41.1 llvmlite==0.41.1
Markdown 3.6 Markdown==3.6
markdown-it-py 3.0.0 markdown-it-py==3.0.0
MarkupSafe 2.1.4 MarkupSafe==2.1.4
matplotlib 3.8.2 matplotlib==3.8.2
matplotlib-inline 0.1.6 matplotlib-inline==0.1.6
mdurl 0.1.2 mdurl==0.1.2
mido 1.3.3 mido==1.3.3
ml-dtypes 0.4.0 ml-dtypes==0.4.0
more-itertools 10.2.0 more-itertools==10.2.0
moviepy 1.0.3 moviepy==1.0.3
mpmath 1.3.0 mpmath==1.3.0
multipledispatch 1.0.0 multipledispatch==1.0.0
mutagen 1.47.0 mutagen==1.47.0
namex 0.0.8 namex==0.0.8
natsort 8.4.0 natsort==8.4.0
nest-asyncio 1.5.9 nest-asyncio==1.5.9
networkx 3.2.1 networkx==3.2.1
ninja 1.11.1.1 ninja==1.11.1.1
nose 1.3.7 nose==1.3.7
numba 0.58.1 numba==0.58.1
numexpr 2.10.0 numexpr==2.10.0
numpy 1.26.3 numpy==1.26.3
openai-whisper 20231117 openai-whisper==20231117
opencv-python 4.10.0.84 opencv-python==4.10.0.84
opencv-python-headless 4.10.0.84 opencv-python-headless==4.10.0.84
openpyxl 3.1.4 openpyxl==3.1.4
opt-einsum 3.3.0 opt-einsum==3.3.0
optree 0.12.1 optree==0.12.1
osqp 0.6.5 osqp==0.6.5
packaging 23.2 packaging==23.2
pandas 2.2.0 pandas==2.2.0
pandas-flavor 0.6.0 pandas-flavor==0.6.0
parso 0.8.3 parso==0.8.3
patsy 0.5.6 patsy==0.5.6
pillow 10.2.0 pillow==10.2.0
platformdirs 4.1.0 platformdirs==4.1.0
pluggy 1.5.0 pluggy==1.5.0
polars 1.9.0 polars==1.9.0
proglog 0.1.10 proglog==0.1.10
prompt-toolkit 3.0.43 prompt-toolkit==3.0.43
protobuf 4.25.4 protobuf==4.25.4
psutil 5.9.8 psutil==5.9.8
pure-eval 0.2.2 pure-eval==0.2.2
pyarrow 15.0.0 pyarrow==15.0.0
pyclipper 1.3.0.post5 pyclipper==1.3.0.post5
pycparser 2.22 pycparser==2.22
pycryptodomex 3.20.0 pycryptodomex==3.20.0
pydotplus 2.0.2 pydotplus==2.0.2
pydub 0.24.1 pydub==0.24.1
Pygments 2.17.2 Pygments==2.17.2
pyjanitor 0.26.0 pyjanitor==0.26.0
PyMuPDF 1.24.9 PyMuPDF==1.24.9
PyMuPDFb 1.24.9 PyMuPDFb==1.24.9
pyparsing 3.1.1 pyparsing==3.1.1
PyPDF2 3.0.1 PyPDF2==3.0.1
pyreadr 0.5.0 pyreadr==0.5.0
pytesseract 0.3.10 pytesseract==0.3.10
pytest 8.3.1 pytest==8.3.1
python-bidi 0.6.0 python-bidi==0.6.0
python-dateutil 2.8.2 python-dateutil==2.8.2
pytube 15.0.0 pytube==15.0.0
pytube3 9.6.4 pytube3==9.6.4
pytz 2023.3.post1 pytz==2023.3.post1
pywin32 306 pywin32==306
PyYAML 6.0.1 PyYAML==6.0.1
pyzmq 25.1.2 pyzmq==25.1.2
qdldl 0.1.7.post1 qdldl==0.1.7.post1
regex 2023.12.25 regex==2023.12.25
requests 2.32.3 requests==2.32.3
rich 13.7.1 rich==13.7.1
rpy2 3.5.16 rpy2==3.5.16
scikit-image 0.24.0 scikit-image==0.24.0
scikit-learn 1.3.2 scikit-learn==1.3.2
scikit-survival 0.22.2 scikit-survival==0.22.2
scipy 1.11.4 scipy==1.11.4
scs 3.2.6 scs==3.2.6
seaborn 0.13.2 seaborn==0.13.2
semantic-version 2.10.0 semantic-version==2.10.0
setuptools-rust 1.8.1 setuptools-rust==1.8.1
shapely 2.0.5 shapely==2.0.5
six 1.16.0 six==1.16.0
soupsieve 2.5 soupsieve==2.5
SpeechRecognition 3.10.1 SpeechRecognition==3.10.1
spyder-kernels 2.5.2 spyder-kernels==2.5.2
stack-data 0.6.3 stack-data==0.6.3
statsmodels 0.14.1 statsmodels==0.14.1
sympy 1.12 sympy==1.12
target 0.0.11 target==0.0.11
tensorboard 2.17.0 tensorboard==2.17.0
tensorboard-data-server 0.7.2 tensorboard-data-server==0.7.2
tensorflow 2.17.0 tensorflow==2.17.0
tensorflow-intel 2.17.0 tensorflow-intel==2.17.0
tensorflow-io-gcs-filesystem 0.31.0 tensorflow-io-gcs-filesystem==0.31.0
termcolor 2.4.0 termcolor==2.4.0
threadpoolctl 3.4.0 threadpoolctl==3.4.0
tifffile 2024.7.24 tifffile==2024.7.24
tiktoken 0.5.2 tiktoken==0.5.2
torch 2.4.0 torch==2.4.0
torchaudio 2.4.0 torchaudio==2.4.0
torchvision 0.19.0 torchvision==0.19.0
tornado 6.4 tornado==6.4
tqdm 4.66.1 tqdm==4.66.1
traitlets 5.14.1 traitlets==5.14.1
translator 0.0.9 translator==0.0.9
typing_extensions 4.9.0 typing_extensions==4.9.0
tzdata 2023.4 tzdata==2023.4
tzlocal 5.2 tzlocal==5.2
urllib3 2.1.0 urllib3==2.1.0
validators 0.33.0 validators==0.33.0
watchdog 3.0.0 watchdog==3.0.0
wcwidth 0.2.13 wcwidth==0.2.13
websockets 12.0 websockets==12.0
Werkzeug 3.0.3 Werkzeug==3.0.3
whisper 1.1.10 whisper==1.1.10
wrapt 1.16.0 wrapt==1.16.0
xarray 2024.1.1 xarray==2024.1.1
youtube-dl 2021.12.17 youtube-dl==2021.12.17
yt-dlp 2024.7.9 yt-dlp==2024.7.9

References

1.
LaZerte SE, Albers S. weathercan: Download and format weather data from environment and climate change canada. The Journal of Open Source Software. 2018;3(22):571. https://joss.theoj.org/papers/10.21105/joss.00571.
2.
Canadian Racer. Cancelled grands prix of canada – 1975 and 1987. https://www.canadianracer.com/cdn-gp-cancel.asp. Published 2003.
3.
Environment and Climate Change Canada. Glossary - Climate - Environment and Climate Change Canada. March 2025.